You are not logged in.

#1 2010-11-29 08:39:41

Vivitronnumbers
Member
Registered: 2010-11-29
Posts: 2

Caps Lock key isn't responding to xmodmap

Hello, I'm trying to reassign some keys with xmodmap on an eee pc with Arch and xmonad. I have my .xinitrc running xmodmap on a file with the following contents:

keycode  34 = parenleft braceleft parenleft braceleft
keycode  35 = parenright  braceright parenright braceright
keycode  18 = 9 bracketleft 9 bracketleft
keycode  19 = 0 bracketright 0 bracketright

remove Lock = Caps_Lock
keysym Caps_Lock = Control_L
add Control = Control_L

The first four lines swap the bracket and paren keys, and that works fine. With the last three I am trying to remap the caps lock key to function as a second left control. xmodmap seems to think that it works (see output below,) but the caps lock key is still functioning as a caps lock.

~$ xmodmap
xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock      
control     Control_L (0x25),  Control_L (0x42),  Control_R (0x6d)
mod1        Alt_L (0x40),  Alt_R (0x71),  Meta_L (0x9c)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x73),  Super_R (0x74),  Super_L (0x7f),  Hyper_L (0x80)
mod5        Mode_switch (0x5d),  ISO_Level3_Shift (0x7c)

I tried a few variants of the caps lock removal lines, including the example in the xmodmap man page that purports to swap the caps lock and left control, and a slight variant on the example in the arch wiki. No matter what I do, though, the caps lock functions as a caps lock.

Here's part of the xev output from when I hit my caps lock key.

    state 0x2, keycode 66 (keysym 0xffe3, Control_L), same_screen YES,
    XKeysymToKeycode returns keycode: 37

Any ideas on what is going wrong?

Last edited by Vivitronnumbers (2010-11-29 20:37:29)

Offline

#2 2010-11-29 17:20:10

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Caps Lock key isn't responding to xmodmap

This works for me on my 901:

# disable CapsLock & map to Escape
setxkbmap -option caps:escape 

# call Xmodap if the above fails
xmodmap ~/.Xmodmap

.Xmodmap

!! Map Caps to Esc
clear Lock
keysym Caps_Lock = Escape

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2010-11-29 20:26:51

Vivitronnumbers
Member
Registered: 2010-11-29
Posts: 2

Re: Caps Lock key isn't responding to xmodmap

Thanks, that seems like a nudge in the right direction but I'm not there yet."setxkbmap  -option capse:escape" works to change caps to an escape, but it also binds home to home-end and is adding an enter key press to the down arrow. It may also cause some other weird behavior - it's hard to tell.

The only change visible in setxkbmap -print is the addition of capslock(escape) :

~$ setxkbmap -print
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)"    };
    xkb_types     { include "complete"    };
    xkb_compat    { include "complete"    };
    xkb_symbols   { include "pc+us+inet(evdev)+capslock(escape)"    };
    xkb_geometry  { include "pc(pc104)"    };
};

When I do a setxkbmap with a blank options to remove the caps lock remap the home and down arrow remain broken.

Last edited by Vivitronnumbers (2010-11-29 20:39:09)

Offline

Board footer

Powered by FluxBB