Hallo, Am Wed, 01 Sep 2004, Can-Carlo Dörtbudak schrieb:
Hallo David,
hier ein Ergebnis nach xmodmap -e 'keycode 116 = Super_R'
xmodmap -e 'keycode 116 = Mode_switch'
KeyPress event, serial 30, synthetic NO, window 0x3200001, root 0x89, subw 0x3200002, time 3765309, (55,44), root:(976,62), state 0x50, keycode 24 (keysym 0x71, q), same_screen YES, XLookupString gives 1 bytes: (71) "q" XmbLookupString gives 1 bytes: (71) "q" XFilterEvent returns: False
Und wie sieht die Ausgabe zum "AltGr" druecken aus? Da schlaegt wohl noch der "Super"-Modifier durch, denn: state 0x0001 = Shift state 0x0002 = Caps_lock state 0x0004 = Ctrl state 0x0008 = Mod1 (normal Alt) state 0x0010 = Mod2 (normal Num_Lock) state 0x0020 = Mod3 (normal Meta) state 0x0040 = Mod4 (normal Super) state 0x0080 = Mod5 (normal Hyper) state 0x2000 = Mode_switch Diese States werden ggfs. addiert, z.B. alle +0x0010 wenn Num_lock mit Mod2 versehen ist und aktiv ist. Oder z.B.: Ctrl + Shift hat state 0x0005. Und Mode_switch + Mod1 + Strg + Shift hat state 0x200d (0x2000 + 0x0008 + 0x0004 + 0x0001). "state 0x50" ist also Mod4 + Mod1 (Super + Num_Lock). Achtung: die Modifier mod1 bis mod5 bekommen ihre Sematik durch das Keysym, an das sie gebunden werden. Folgendes: state 0x0008 = Mod1 (Num_Lock) state 0x0010 = Mod2 (Hyper) state 0x0020 = Mod3 (Super) state 0x0040 = Mod4 (Meta) state 0x0080 = Mod5 (Alt) waere also genauso gut moeglich. ==== man xkeycaps (reformatiert) ==== Modifier Bit Modifier bits are attributes which certain keysyms can have. Some modifier bits have predefined 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. That is, the Control modifier means Control if it is attached to Control_L or Control_R, and is illegal elsewhere. But Mod1 means Meta if it is attached to Meta_L or Meta_R; but it would mean Alt if it were attached to Alt_L or Alt_R; or Hyper with Hyper_L or Hyper_R; and so on. (It could not, however, be attached to Control_L, since the Control modifier has already spoken for those keysyms.) If you're thinking that this is all senselessly complicated... you're right. ==== Diese manpage sollte man sowieso mal lesen. AFAIK ist die Keymap bei SUSE immer noch nicht sauber... Jedenfalls helfen dann 'xmodmap -pm' und xev zur Aufklaerung: $ xmodmap -pm xmodmap: up to 2 keys per modifier, (keycodes in parentheses): shift Shift_L (0x32), Shift_R (0x3e) lock Caps_Lock (0x4e) control Control_L (0x25), Control_R (0x6d) mod1 Alt_L (0x40), Alt_R (0x71) mod2 Num_Lock (0x4d) mod3 Meta_R (0x75) mod4 Super_R (0x6e) mod5 $ xmodmap -e 'keycode 110 = Super_R' -e 'clear mod4' -e 'clear mod5' -e 'add mod5 = Super_R' $ xmodmap -pm [..] mod3 Meta_R (0x75) mod4 mod5 Super_R (0x6e) $ xmodmap -e 'keycode 110 = Super_R' -e 'clear mod4' -e 'clear mod5' -e 'add mod4 = Super_R' 'xev' zeigt jeweils "state" fuer "Super_R" mit Mod4 0x0040 und mit Mod5 0x0080. D.h. die Semantik "Super" ist wirklich unabhaengig vom jew. gewaehlten Modifier. Versuch's also mal mit: xmodmap -e 'keycode 116 = Mode_switch' -e 'clear Mod4' Zurueck: xmodmap -e 'keycode 116 = Super_R -e 'clear Mod4' \ -e 'add Mod4 = Super_R' BTW: das ganze kann man dann natuerlich in der ~/.Xmodmap festhalten und automatisieren, auch dann, wenn man KDE verwendet. -dnh -- "AOL has proven that they have the ability to send a CD or three to every chordate on the planet once a month." -- Douglas Henke "That's not even a requirement; my pet cactus was getting them for a while after I signed him up for a free magazine subscription." -- Joe Bramblett