I'm currently using the Caps key as ISO_Level3_shift
and I'm mapping the h,j,k,l,$ and 0 to vim keys. It works and everything is fine. However, I use SQL and I want to write all the code for SQL in capital letters so it would be hard to press the shift key while typing every letter. So, what I want is someway of using this vim keys as is, but also having the ability to toggle Caps lock when doing some SQL programming. maybe something like holding it for a while or pressing shift+caps to toggle it back.
I'm using XKB to achieve what I'm doing as xmodmap doesn't work for me as I use a second layout which will not work correctly if I use xmodmap.
Here is my /usr/share/X11/xkb/symbols/us
file - or at least part of it where I set my current setup:
key <AC06> { [ h, H, Left ] };
key <AC07> { [ j, J, Down ] };
key <AC08> { [ k, K, Up ] };
key <AC09> { [ l, L, Right ] };
key <AE10> { [ 0, parenright, Home ] };
key <AE04> { [ 4, dollar, End ] };
key <CAPS> { [ ISO_Level3_Shift ] };
this portion is inside the
default partial alphanumeric_keys modifier_keys
xkb_symbols "basic" {}
block
Thanks in advance for your help.