Search code examples
ubuntu-20.04custom-keyboardalphanumeric

Remapping minus key on numeric keyboard


I'm new to linux and even after after searching for more than an hour and help from my IT friends I didn't find a "name" for minus key on numeric keyboard. I'm searching for something like

 key <PAUS> { [ Home ] };
 key <INS>  { [ End ] };

specifically that first part out of the brackets. I've already tried

key <MNS>, key <MINS>, key <MNUS>

but it broke my keyboard (I ended up with EN keyboard), which I assume means, there's a mistake in the code.

Does anybody know the "name"? Thanks.


Solution

  • Open a terminal and:

    xev -event keyboard
    

    Press the minus key on numeric keyboard and see the key code.
    On my system I obtain this output:

    KeyRelease event, serial 28, synthetic NO, window 0x1c00001,
        root 0x31b, subw 0x0, time 1053670, (75,41), root:(1768,207),
        state 0x0, keycode 82 (keysym 0xffad, KP_Subtract), same_screen YES,
        XLookupString gives 1 bytes: (2d) "-"
        XFilterEvent returns: False
    

    The keycode is 82

    I see from your tag that you are using Ubuntu 20.04.
    You can see that the file /usr/share/X11/xkb/symbols/pc has the line:

    keycode  82 = KP_Subtract KP_Subtract KP_Subtract KP_Subtract KP_Subtract KP_Subtract XF86Prev_VMode