Bug 7095 - Duplicate XF86AudioRaiseVolume entry in inet(logitech_base)
Summary: Duplicate XF86AudioRaiseVolume entry in inet(logitech_base)
Status: RESOLVED FIXED
Alias: None
Product: xkeyboard-config
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: high normal
Assignee: xkb
QA Contact:
URL:
Whiteboard:
Keywords:
: 7277 8282 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-06-02 08:17 UTC by Stefan Dirsch
Modified: 2006-09-15 13:57 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
inet_logitech_base_xf86audioraisevolume.diff (587 bytes, patch)
2006-06-02 08:21 UTC, Stefan Dirsch
Details | Splinter Review
rules_logi_typo.diff (537 bytes, patch)
2006-06-02 09:00 UTC, Stefan Dirsch
Details | Splinter Review

Description Stefan Dirsch 2006-06-02 08:17:38 UTC
See $subject. Some details in Novell Bugzilla #181118

--> https://bugzilla.novell.com/show_bug.cgi?id=181118&x=8&y=7&=Find

I'll attach a patch.
Comment 1 Stefan Dirsch 2006-06-02 08:21:27 UTC
Created attachment 5787 [details] [review]
inet_logitech_base_xf86audioraisevolume.diff
Comment 2 Stefan Dirsch 2006-06-02 09:00:31 UTC
Created attachment 5788 [details] [review]
rules_logi_typo.diff

description fix. On SUSE SaX2 uses the wrong keyboard for configuration
("logiink" instead of "logicink") because of this typo.
Comment 3 Sergey V. Udaltsov 2006-06-02 10:10:03 UTC
Stefan, having two keys for the same symbol is not a problem - both definitions
should work ok. The real bug is with the code which is binding these definitions
to keycodes - it should be aware that one symbol can be bound to different
keycodes. From X and XKB POV it is perfectly legal configuration IMHO.
I would prefer just to leave it as it is now. 
But wrong identifier is a realy bug, so I'll fix it ASAP.
Comment 4 Sergey V. Udaltsov 2006-06-02 10:43:54 UTC
The ID bug is fixed, thanks. The rest I'd consider as INVALID or NOTOURBUG...
Comment 5 Denis Barbier 2006-06-02 13:00:44 UTC
(In comment #3)
> Stefan, having two keys for the same symbol is not a problem

Sergey, we had a similar report in Debian BTS http://bugs.debian.org/363925
Bug submitter tells that his key does not work with GNOME when there are
such duplicates.  I do not have GNOME installed at the moment, this is why
I did not investigate it yet.
Comment 6 Sergey V. Udaltsov 2006-06-02 13:04:45 UTC
As I said - it looks like a problem with GNOME. It goes nuts trying to map the
symbol name to keycode - it just does not take into account the fact that this
mapping may be a vector...
Comment 7 Stefan Dirsch 2006-06-02 18:05:22 UTC
Thanks!
Comment 8 Lubos Lunak 2006-06-20 04:43:02 UTC
I disagree with comment #3. First of all it is just plain against common sense 
to write code to handle possible mapping of one keysym to several keycodes just 
because of weird cases like this, and secondly it's not possible (Xlib manual 
section 16.1 or just the manpage):

KeyCode XKeysymToKeycode(Display *display, KeySym keysym);

The function prototype makes it obvious that from X POV it is not legal to have 
one keysym mapped to several keycodes. Please fix the keymap.
Comment 9 Ryan Reich 2006-06-20 05:31:37 UTC
*** Bug 7277 has been marked as a duplicate of this bug. ***
Comment 10 Sergey V. Udaltsov 2006-06-20 05:44:22 UTC
> I disagree with comment #3. First of all it is just plain against common sense 
Is it? What is people what two keys perform absolutely same action, regardless
of the application?

> because of weird cases like this, and secondly it's not possible (Xlib manual 
> section 16.1 or just the manpage):
OK, this is the killer argument. Funny but neither XKB internal structures nor
file formats prevent from having multiple keycodes per keysym. It is only in
core X11 where this causes the conflict. Anyway, you nearly convinced me. I will
have a look around, see if I find any clarifications on this ambiguity between X
and XKB - and most probably will do something about it.
Comment 11 Sergey V. Udaltsov 2006-06-20 06:29:11 UTC
There is an interesting message from Danilo Segan on XKB maillist, which I cite
here (as he asked):
---------------------------------------------
> > because of weird cases like this, and secondly it's not possible
> (Xlib manual
> > section 16.1 or just the manpage):
(reinserted the prototype)
> >
> > KeyCode XKeysymToKeycode(Display *display, KeySym keysym);
> >
> OK, this is the killer argument. Funny but neither XKB internal
> structures nor
> file formats prevent from having multiple keycodes per keysym. It is
> only in
> core X11 where this causes the conflict. Anyway, you nearly convinced
> me. I will
> have a look around, see if I find any clarifications on this ambiguity
> between X
> and XKB - and most probably will do something about it.

Not really—if the prototype was actually reverse:

  KeySym XKeycodeToKeysym(Display *display, KeyCode keycode);

then this would be the case.  Algebraic definition of the function
allows for having more than one value mapped to a single value.

And the man page actually supports your initial comment with a different
function for reverse mapping:

      KeySym XKeycodeToKeysym(Display *display, KeyCode keycode, int
index);

where index "Specifies the element of KeyCode vector." (so, it is
expected to have more than one).

So, no, it's not a bug in xkeyboard-config.
---------------------------------------------
Comment 12 Sergey V. Udaltsov 2006-06-20 06:36:23 UTC
Danilo, I think it is still a bug. You see, the question here is whether we can
have, say KC1 and KC2 mapped to KS1 (two keycodes mapped to one keysym). The
function XKeysymToKeycode can only return one keycode for the keysym (say, KC1
for KS1) - so there is no place for KC2 in this API.
Comment 13 Sergey V. Udaltsov 2006-06-20 06:44:37 UTC
Danilo agreed :)
Comment 14 Lubos Lunak 2006-06-20 07:07:24 UTC
Re: comment #11:
You misunderstand. If an app is supposed to react e.g. on XF86VolumeUp, then it 
needs to do a global grab. But XGrabKey() needs a keycode. However 
XKeySymToKeyCode() only returns one keycode for the keysym, so it's possible to 
grab only one of the two keys.

Moreover the index in XKeycodeToKeysym() has nothing to do with mapping one 
keysym to two keycodes. It's the index which specifies which keysym for a 
particular keycode should be selected according to group and lock modifiers, as 
explained in Xlib reference section 12.7.
Comment 15 Sergey V. Udaltsov 2006-06-22 12:40:06 UTC
Fixed in CVS
Comment 16 Denis Barbier 2006-09-15 13:57:24 UTC
*** Bug 8282 has been marked as a duplicate of this bug. ***


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.