Re: [PATCH 0/5] Sonypi driver model & PM changes

From: Stelian Pop
Date: Tue Oct 26 2004 - 04:46:55 EST


On Mon, Oct 25, 2004 at 06:04:27PM +0200, Vojtech Pavlik wrote:

> > KeyRelease event, serial 24, synthetic NO, window 0x2a00001,
> > root 0x40, subw 0x2a00002, time 6566259, (37,47), root:(542,70),
> > state 0x20, keycode 214 (keysym 0x8f6, function), same_screen YES,
> > XLookupString gives 0 bytes:
>
> Watch the "state" variable.

Indeed, I didn't noticed it.

However, this still doesn't work as expected. I looked at WindowMaker's
code for grabbing a key and found out it uses the standard IsModifierKey
macro, which is defined in X11/Xutil.h as:

#define IsModifierKey(keysym) \
((((KeySym)(keysym) >= XK_Shift_L) && ((KeySym)(keysym) <= XK_Hyper_R)) \
|| (((KeySym)(keysym) >= XK_ISO_Lock) && \
((KeySym)(keysym) <= XK_ISO_Last_Group_Lock)) \
|| ((KeySym)(keysym) == XK_Mode_switch) \
|| ((KeySym)(keysym) == XK_Num_Lock))

So it clearly handles only some special modifier keys.

Moreover, the xkeycaps manpage (available at
http://wwwvms.mppmu.mpg.de/unix_man_pages/xkeycaps.html) goes a bit
more in-depth and says:

Modifier Bit
Modifier bits are attributes which certain
keysyms can have. Some modifier bits have pre­
defined semantics: Shift, Lock, and Control.
The remaining modifier bits (Mod1 through Mod5)
have semantics which are defined by the keys
with which they are associated.

So I'm back where I started, I cannot see how to define my new
'Fn' key to be interpreted as a 'ModX' modifier by X.

I will probably go now the new evdev based X driver, and will use
new, above 240, keycodes for all key combinations. Provided the
Gentoo patches build and work correctly.

Stelian.
--
Stelian Pop <stelian@xxxxxxxxxx>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/