1

The arrow keys and others on the numeric keypad do not work when NumLock is turned off. I know how to make them work using X11(shown below). How do I make them work using Wayland?

X11

Creating file sudo nano /usr/share/X11/xkb/symbols/custom_numpad_full

with text

default partial alphanumeric_keys modifier_keys
xkb_symbols "basic" {
    include "us+ru:2"
key <KP4>  { [ Left,  KP_4 ] };
key <KP6>  { [ Right, KP_6 ] };
key <KP8>  { [ Up,    KP_8 ] };
key <KP2>  { [ Down,  KP_2 ] };
key <KP7>  { [ Home,  KP_7 ] };
key <KP9>  { [ Prior, KP_9 ] };
key <KP1>  { [ End,   KP_1 ] };
key <KP3>  { [ Next,  KP_3 ] };
key <KPDL> { [ Delete, KP_Decimal ] };

key <KPAD> { type="KEYPAD",
             symbols[Group1]= [ KP_Add, KP_Add ],
             actions[Group1]= [ RedirectKey(key=<KPAD>, clearmods=NumLock) ]
};
key <KPSU> { type="KEYPAD",
             symbols[Group1]= [ KP_Subtract, KP_Subtract ],
             actions[Group1]= [ RedirectKey(key=<KPSU>, clearmods=NumLock) ]
};
key <KPMU> { type="KEYPAD",
             symbols[Group1]= [ KP_Multiply, KP_Multiply ],
             actions[Group1]= [ RedirectKey(key=<KPMU>, clearmods=NumLock) ]
};
key <KPDV> { type="KEYPAD",
             symbols[Group1]= [ KP_Divide, KP_Divide ],
             actions[Group1]= [ RedirectKey(key=<KPDV>, clearmods=NumLock) ]
};

};

and run

setxkbmap -layout custom_numpad_full

It works, but I noticed such a nuisance: Del does not work in some program. You go into another one, it works there. You come back - and then Del started working

1 Answers1

0

Partial answer in a hurry: Wayland compositors also generally use the same XKB, so you might be able to define a custom keymap using these instructions:

i.e. placing a keymap in ~/.config/xkb/.

grawity
  • 501,077