View Single Post
Posts: 52 | Thanked: 226 times | Joined on Feb 2011 @ CZ & US ex-(UK/France/Switzerland/Canada)
#130
Originally Posted by Wolda View Post
Hi, the sticky SHIFT key can be obtained by adding the following lines to the first block in "/usr/share/X11/xkb/symbols/us" :

Code:
    key <LFSH> {
        type[Group1]="ONE_LEVEL",
        symbols[Group1]=[ ISO_Level2_Latch]
    };
    modifier_map Shift { Shift_L, ISO_Level2_Latch};
Unfortunately, this seems to be buggy because it sends some escape character that makes crazy programs like vi or ssh when entering passphrases. Any ideas how to fix this?

Allright, a dirty hack that makes SHIFT sticky and doesn't do a mess in vim. We basically redefine CAPS_LOCK function to do the sticky SHIFT, and then assign the SHIFT key the CAPS_LOCK function.

File "/usr/share/X11/xkb/compat/caps" :
Code:
interpret Caps_Lock { action = LatchMods(modifiers = Shift);}
File "/usr/share/X11/xkb/symbols/us" :
Code:
key <LFSH> { [Caps_Lock] };
key <BKSP> { [BackSpace, Delete ] };
key <RTRN> { [Return, bar] };
key <CAPS> { [Escape, backslash] };
key <TAB> { [Tab, greater] };
key <SPCE> { [ space, less] };
I bet there is a less lopsided way of doing this, but since I live and die with vi, I'm currently being happy with the solution.

Last edited by Wolda; 2018-07-22 at 18:21.
 

The Following 2 Users Say Thank You to Wolda For This Useful Post: