[vox-tech] using xmodmap to swap modifier key locations

vox-tech@lists.lugod.org vox-tech@lists.lugod.org
Wed, 8 Oct 2003 22:20:40 -0700


hi henry,

sorry to do this to you, but the man page example actually works for me;
it swaps my caps lock and left control keys.

my current keyboard is a memorex MX 3000.  one of those "angled away"
designs that's supposed to be a more natural positions for your wrists
and hands.

here's my keyboard section:

   Section "InputDevice"
      Identifier  "Generic Keyboard"
      Driver      "keyboard"
      Option      "CoreKeyboard"
      Option      "XkbRules"   "xfree86"
      Option      "XkbModel"   "pc104"
      Option      "XkbLayout"  "us"
      Option      "XkbVariant" "microsoft"
   EndSection

my last keyboard was a microsoft "angled away" keyboard.  they must have
the same real manufacturer (they look the same).

anyway, try adding these lines if you think they're relevent (i have to
admit that keyboard stuff under linux is too uninteresting for me to
really get to know well).

   Option      "XkbRules"   "xfree86"
   Option      "XkbModel"   "pc104"
   Option      "XkbLayout"  "us"
   Option      "XkbVariant" "microsoft"

oh, one more thing.  here's my xevent for the caps lock:

KeyPress event, serial 25, synthetic NO, window 0xe00001,
    root 0x56, subw 0xe00002, time 1263659015, (37,45), root:(693,64),
    state 0x2, keycode 23 (keysym 0xff09, Tab), same_screen YES,
    XLookupString gives 1 characters:  "        "

and here's my left control key:

KeyPress event, serial 25, synthetic NO, window 0xe00001,
    root 0x56, subw 0xe00002, time 1263730336, (36,50), root:(692,69),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 characters:  ""

see if you have the same keycodes/keysyms as i do.

even though i'm grasping at straws, i hope something in here helps.  :(

pete





On Wed 08 Oct 03, 10:05 PM, Henry House <hajhouse@houseag.com> said:
> The manual page for xmodmap lists the following example (exact quote):
> 
> 	!
> 	! Swap Caps_Lock and Control_L
> 	!
> 	remove Lock = Caps_Lock
> 	remove Control = Control_L
> 	keysym Control_L = Caps_Lock
> 	keysym Caps_Lock = Control_L
> 	add Lock = Caps_Lock
> 	add Control = Control_L
> 
> which is said to turn the left caps lock key into a control key and the left
> control key into a caps lock key. It does not work. On my system, running the
> above commands (saved to a file, then run using 'xmodmap <filename>') turns
> the left control key into a shift key (!) and has no effect on the caps lock
> key. Neither xmodmap nor the x server print any errors or other messages.
> Does anyone have a suggestion? My XFree86 config file follows. 
> 
> 
> Section "InputDevice"
>     Identifier	"Keyboard1"
>     Driver	"Keyboard"
>     Option "AutoRepeat" "500 30"
>     #Option "XkbRules"	"xfree86"
>     #Option "XkbModel"	"pc101"
>     #Option "XkbLayout"	"us"
> EndSection



-- 
GPG Instructions: http://www.dirac.org/linux/gpg
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D