I know someone who'd really like to be able to type with only the left hand, so I had the idea of writing a layout which "switches" the sides of the keyboard when the caps lock key is pressed.

For example, in the QWERTY layout, the qwerty keys would be remapped to uiop[].

I wrote the following xmodmaprc (caps lock line at the bottom):

keycode 24 = q Q u U
keycode 25 = w W i I
keycode 26 = e E o O
keycode 27 = r R p P
keycode 28 = t T bracketleft braceleft
keycode 29 = y Y bracketright braceright

keycode 30 = u U q Q
keycode 31 = i I w W
keycode 32 = o O e E
keycode 33 = p P r R
keycode 34 = bracketleft braceleft t T
keycode 35 = bracketright braceright y Y

keycode 38 = a A j J
keycode 39 = s S k K
keycode 40 = d D l L
keycode 41 = f F semicolon colon
keycode 42 = g G apostrophe quotedbl
keycode 43 = h H Return Return

keycode 44 = j J a A
keycode 45 = k K s S
keycode 46 = l L d D
keycode 47 = semicolon colon f F
keycode 48 = apostrophe quotedbl g G
keycode 36 = Return Return h H

keycode 52 = z Z n N
keycode 53 = x X m M
keycode 54 = c C comma less
keycode 55 = v V period greater
keycode 56 = b B slash question

keycode 57 = n N z Z
keycode 58 = m M x X
keycode 59 = comma less c C
keycode 60 = period greater v V
keycode 61 = slash question b B

keysym Caps_Lock = Mode_switch

However, this only works when holding the Caps Lock key, and doesn't "toggle" the mode by tapping it.

Am I missing something simple, or am I trying to solve this issue the wrong way?

  • 1
    There is already a left-hand keyboard layout. Look at the alternative layouts section for QWERTY layout with the conversion tool mentioned on the main page.
    – erik
    Jan 23, 2014 at 23:32

1 Answer 1


This works for me:

keycode 38 = a A j J
! can also use: keysym a = a A j J
clear Lock
keysym Caps_Lock = ISO_Next_Group Caps_Lock

Pressing Caps_Lock switches the a key to j J. Pressing Caps_Lock again switches it back to a A.

Pressing shift + Caps_Lock activates the normal Caps_Lock.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .