Celeb Glow
updates | March 27, 2026

How to switch keys symbols on holding ALT?

I wanna emulate numpad on letters uiojklm,.

I edited french layout in /usr/share/X11/xkb/symbols (see image below).
But I have to switch layout in order to use what I've done there.
I would like if for certain layout I could just hold Alt.

There is two options how I would like to switch to numbers:
-change to certain layout while holding Alt;
-keys print different symbols while holding Alt;
(or after activating Caps Lock)

enter image description here

5

1 Answer

I edited the English (US) keyboard layout like this:

$ diff /usr/share/X11/xkb/symbols/us.orig /usr/share/X11/xkb/symbols/us
26,28c26,28
< key <AD07> { [ u, U ] };
< key <AD08> { [ i, I ] };
< key <AD09> { [ o, O ] };
---
> key <AD07> { [ u, U, 7 ] };
> key <AD08> { [ i, I, 8 ] };
> key <AD09> { [ o, O, 9 ] };
39,41c39,41
< key <AC07> { [ j, J ] };
< key <AC08> { [ k, K ] };
< key <AC09> { [ l, L ] };
---
> key <AC07> { [ j, J, 4 ] };
> key <AC08> { [ k, K, 5 ] };
> key <AC09> { [ l, L, 6 ] };
51,53c51,53
< key <AB07> { [ m, M ] };
< key <AB08> { [ comma, less ] };
< key <AB09> { [ period, greater ] };
---
> key <AB07> { [ m, M, 1 ] };
> key <AB08> { [ comma, less, 2 ] };
> key <AB09> { [ period, greater, 3 ] };
56a57,58
>
> include "level3(ralt_switch)"

That way I can type numbers like this:

Right Alt+U -> 7

Right Alt+K -> 5

etc.

The line

include "level3(ralt_switch)"

enables the third level mechanism; in this case Right Alt which is default for those keyboard layouts which make use of third and fourth level symbols, but it can be changed.

8

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy