I'm looking to modify my keyboard layout such that holding down Shift and pressing a number key will result in a number being printed to the screen instead of the symbol that's on the key.

For example SHIFT+9 would print 9, while 9 will print (.

I'd also like to switch "[" and "]" with "{" and "}" respectively, in the same manner.

I suspect the program setxkbmap will be useful, but I don't know how to use it for this purpose.

Incidentally, there exists a similar question, but it's not exactly what I'm looking for.

I use Linux Mint 16 Mate Edition.


You will need to use xev and xmodmap.

Check out the following answer: https://askubuntu.com/questions/24916/how-do-i-remap-certain-keys

About halfway down the answer it addresses using the shift key.

For example, in the case of the 9 key:

xmodmap -e "keycode 18 = parenleft 9"

From the man pages:

keycode NUMBER = KEYSYMNAME ... The list of keysyms is assigned to the indicated keycode (which may be specified in decimal, hex or octal and can be determined by running the xev program). Up to eight keysyms may be attached to a key, however the last four are not used in any major X server implementation. The first keysym is used when no modifier key is pressed in conjunction with this key, the second with Shift, the third when the Mode_switch key is used with this key and the fourth when both the Mode_switch and Shift keys are used.

| improve this answer | |

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.