Ubuntu – How to specify which keys CapsLock affects

capslockkeyboard-layout

Using Maverick, I am not able to get the CapsLock behaviour I want: I would like it to affect essentially the alphabetical, numerical, and punctuation keys, i.e. all the keys that print something (as opposed to, say, the arrow keys), but only them.

To illuminate this with an example: when writing code that uses % as the symbol for a comment, I want to be able to position the cursor at the start of a range of lines I want to comment out, then hit CapsLock, then iteratively hit the 5 key (using QWERTZ, Shift+5 gives %) and the arrow down key, so that I can quickly place a % at the start of the lines.

Ubuntu in default configuration takes CapsLock literally, so that it affects only alphabetic keys. Under Preferences/Keyboard/Layout/Options I can make it act as a pressed Shift, but then the action of the arrow keys is to select text. All the other options available are equivalent to one of these two in my case.

Is it possible to somehow get this behaviour? This is standard in Windows.

Edit: @Mikel: I use English language with German keyboard layout. Yes, by googling I found out about this Belgian problem and the fix, but I hoped that there was an easier way, as I just want the Windows behaviour. Let's see whether I get it to work.

Best Answer

Answers in the comment lead to the impression that there is no easy GNOME setting to toggle. Vote up mikel's answer in the comments, not mine: http://launchpadlibrarian.net/29195040/mswindows-capslock.patch to adapt the belgian solution.