3

I haven't figured out how you configure XKB to use the numpad yet. I found the following in the "us" file.

partial alphanumeric_keys modifier_keys 
xkb_symbols "basic" {

    name[Group1]= "USA";

    // Alphanumeric section
    key <TLDE> {    [     grave,    asciitilde  ]   };
    key <AE01> {    [     1,    exclam      ]   };
    key <AE02> {    [     2,    at      ]   };
    key <AE03> {    [     3,    numbersign  ]   };
    key <AE04> {    [     4,    dollar      ]   };
    key <AE05> {    [     5,    percent     ]   };
    key <AE06> {    [     6,    asciicircum ]   };
    key <AE07> {    [     7,    ampersand   ]   };
    key <AE08> {    [     8,    asterisk    ]   };
    key <AE09> {    [     9,    parenleft   ]   };
    key <AE10> {    [     0,    parenright  ]   };
    key <AE11> {    [     minus,    underscore  ]   };
    key <AE12> {    [     equal,    plus        ]   };

    key <AD01> {    [     q,    Q       ]   };
    key <AD02> {    [     w,    W       ]   };
    key <AD03> {    [     e,    E       ]   };
    key <AD04> {    [     r,    R       ]   };
    key <AD05> {    [     t,    T       ]   };
    key <AD06> {    [     y,    Y       ]   };
    key <AD07> {    [     u,    U       ]   };
    key <AD08> {    [     i,    I       ]   };
    key <AD09> {    [     o,    O       ]   };
    key <AD10> {    [     p,    P       ]   };
    key <AD11> {    [ bracketleft,  braceleft   ]   };
    key <AD12> {    [ bracketright, braceright  ]   };

    key <AC01> {    [     a,    A       ]   };
    key <AC02> {    [     s,    S       ]   };
    key <AC03> {    [     d,    D       ]   };
    key <AC04> {    [     f,    F       ]   };
    key <AC05> {    [     g,    G       ]   };
    key <AC06> {    [     h,    H       ]   };
    key <AC07> {    [     j,    J       ]   };
    key <AC08> {    [     k,    K       ]   };
    key <AC09> {    [     l,    L       ]   };
    key <AC10> {    [ semicolon,    colon       ]   };
    key <AC11> {    [ apostrophe,   quotedbl    ]   };

    key <AB01> {    [     z,    Z       ]   };
    key <AB02> {    [     x,    X       ]   };
    key <AB03> {    [     c,    C       ]   };
    key <AB04> {    [     v,    V       ]   };
    key <AB05> {    [     b,    B       ]   };
    key <AB06> {    [     n,    N       ]   };
    key <AB07> {    [     m,    M       ]   };
    key <AB08> {    [     comma,    less        ]   };
    key <AB09> {    [    period,    greater     ]   };
    key <AB10> {    [     slash,    question    ]   };

    key <BKSL> {    [ backslash,         bar    ]   };
    // End alphanumeric section
};

And I was notified of http://cgit.freedesktop.org/xkeyboard-config/tree/symbols/keypad , but I was wondering if there was a resource/manual to make sense of it, and how to modify it.

3
  • 1
    Have you looked in the keypad symbols file? – alanc Nov 22 '11 at 17:40
  • Looks like that would help, I'll post an answer if I figure out what that file is exactly doing... – Not a Name Nov 26 '11 at 0:19
  • Note: Still haven't figured it out. – Not a Name Feb 27 '12 at 19:01
4

Those lines are to be read like this:

key <key_identifier> { [ Symbol(s)_actually_sent ] };

the symbols are separated with commas, if more than one; the first is sent when pressing the key, the second when pressing with Shift, the third when pressing with AltGr, the fourth when pressing AltGr+Shift.

the identifiers of the numpad keys are those starting with <KO.>; those for direction keys are named <KP.>; some have particular names too.

If you want to redefine some of those keys, you have to write lines similar to the one above. If you want to just enable them, then it is more than likely you just need to load an existing keypad definition. eg: setxkbmap "us+keypad(x11)" (there are a lot of keypad definitions you can use, you can look at file /usr/share/X11/xkb/symbols/keypad ).

Also, choosing the proper keyboard model/geometry should also automatically enable it.

0

Updating iomartin's answer from 2012-04-27: The documentation now lives at: https://www.charvolant.org/doug/xkb/html/node5.html

It is part of the "An Unreliable Guide to XKB Configuration" by Doug Palmer: https://www.charvolant.org/doug/xkb/html/xkb.html

Another introduction is "Changing Keyboard Layouts with XKB" by Michael Cardell Widerkrantz: https://hack.org/mc/writings/xkb.html

Or "A simple, humble but comprehensive guide to XKB for linux" by Damiano Venturin: https://medium.com/@damko/a-simple-humble-but-comprehensive-guide-to-xkb-for-linux-6f1ad5e13450

Other sources of information:

There are also tools to assist with generating a layout configuration, like kbdgen: https://divvun.github.io/kbdgen/

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.