gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Modifier mapping in X11


From: Adrian Robert
Subject: Modifier mapping in X11
Date: Tue, 03 Aug 2004 09:25:04 -0400


Hi,

After wondering for a while why emacs-like keybindings were defined in my DefaultKeyBindings.dict but not showing up in any apps, I realized that GNUstep was apparently not picking up my keymap modifications set either with xmodmap or in the XFree86 config file. E.g., I map my caps-lock key to another left-control, but GNUstep apps don't pick up control commands, instead inserting characters into the text, as in "".

I traced this to X11/XGServerEvent.m in 'back'. It checks modifier status by first converting the defaults like "GSFirstControlKey" into single X KeyCodes on init, then comparing KeyCodes received from the X server with these. The problem is that X conceptually maps modifiers to KeySyms, not KeyCodes. A KeySym is something like "Control_L" and is what you specify in 'GSFirstControlKey', etc.. A KeyCode is a number corresponding to a physical key, and more than one of these can map to the same KeySym. GNUstep should compare the KeySym rather than the KeyCode to determine if a modifier is pressed. (See, e.g., XGetModifierMapping(); also, I'm not sure how the XKeysymToKeycode() function currently used in XGServerEvent picks the code to return for a sym with more than one.)

Is there any reason not to make this change? Will it interact badly with any locale / input method code? If not and no one else wants to do it I can take a stab at this and send out a patch for people to try..

Adrian






reply via email to

[Prev in Thread] Current Thread [Next in Thread]