I'm trying to remap my parenthesis and bracket keys to a more comfortable position on my keyboard.

Would it be possible to create a NEW modifier key (such as Control or Shift) in Xmodmap and then assign to caps lock? Something that would allow me to hold down caps lock and then press something such as Y or T and result in the output of ( or )?

If that is not possible is it possible to remap the shift modified output of certain keys? For example, the shift of 1 is !. Is it possible to remap the shift of 1 from ! to (.

Another possibility that I read about from https://stackoverflow.com/questions/17644556/shift-key-training-wheels-and-shift-parenthesis-remap, is for anytime I roll the two shiftkeys (press LShift, press RShift, release LShift, releaseRShift) to release a "()". How would I implement these?


If you need a new modifier key you might be able to use mode_switch key. Its keycode is 203 (I think) so on normal keyboards it's probably not there and not used (that is at least the situation with my keyboard).

For achieving what you want you can use the xmodmap tool. See: https://wiki.archlinux.org/index.php/xmodmap

I personally wanted to place the arrow keys in the middle of the keyboard (j - down; u - up ; h left; k - right) since it is annoying moving your hand to get to them.

What I did is: create a file and put in it the following:

keycode 66 = Mode_switch NoSymbol
keycode 30 = u U Up Up
keycode 43 = h H Left Left
keycode 44 = j J Down Down
keycode 45 = k K Right Right
keycode 38 = a A Caps_Lock Caps_Lock

now Run: xmodmap

and you're done.

I think that if you place it under ~/.Xmodmap then it is loaded when you logged in (so you don't have to call it manually), though I haven't checked it yet.

  • For followers, parenthesis is called "parenright" etc. ;) – rogerdpack Feb 15 at 21:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.