I've been suffering from RSI recently and am trying to make an effort to be more disciplined about typing. One of the things I've noticed is that I sometimes (out of habit) use combinations of keys that force me to stretch.

For example, to type an open-paren ( I often hold down right-shift and use my right hand to press the 9 key. This involves twisting my wrist uncomfortably. I would like to train myself to hold down the left shift key instead but it's hard to get out of the habit.

Is there an application that will allow me to either (1) disable the combination of right-shift + 9 or (2) pop up a reminder when I hit that particular combination? I guess it would have to be something that works across applications.

I figured out that xmodmap was the correct solution here. In the .Xmodmap file, turn off shift, then add right shift as mode switch and add left shift as shift:

clear Shift
keysym Shift_R = Mode_switch
add Shift = Shift_L

Now the order of the first few keysym columns is key, left_shift+key, right_shift+key. So for my parentheses example:

keycode  18 = 9 parenleft 9 parenleft bracketright plusminus bracketright

Because right shift now is no longer recognized as shift, it will stop working for all keys until you put it back in the third column e.g. I want a to work with right shift but not left shift:

keycode  38 = a a A A ae AE ae

Hint: if you mess things up while playing about with xmodmap, run

setxkbmap

to return everything to a default state.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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