User Tools

Site Tools


ubuntu:mouse:map_mouse_buttons_to_arbitrary_functions:identify_the_key_codes_to_use

Ubuntu - Mouse - Map Mouse Buttons to Arbitrary Functions - Identify the key codes to use

Every key combination returns a specific key code.


For Single Keys

xbindkey -k

NOTE: Wait for the popup window to show, and then press a key.

  • For example, pressing d, returns:
    Press combination of keys or/and click under the window.
    You can use one of the two lines after "NoCommand"
    in $HOME/.xbindkeysrc to bind a key.
    "(Scheme function)"
        m:0x0 + c:40
        d
  • This returns d. which can be used to refer to this key press.

NOTE: Some keycodes cover special characters.

  • For example, pressing PAGE_DOWN, returns:
    Press combination of keys or/and click under the window.
    You can use one of the two lines after "NoCommand"
    in $HOME/.xbindkeysrc to bind a key.
    "(Scheme function)"
        m:0x0 + c:117
        Next
  • This returns Next. which could be used to refer to this key press.

A list of other Special Keys include (case sensitive):

  • Home, End
    Left, Up, Right, Down
    Page_Up, Page_Down
    Return
    BackSpace
    Tab
    Escape
    Delete
    Shift_L, Shift_R
    Control_L, Control_R
    Meta_L, Meta_R
    Alt_L, Alt_R 
    F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12
    grave
    numbersign
    apostrophe
    bracketleft, bracketright
    backslash, slash
    Caps_Lock

NOTE: Some keycodes are special, known as modifiers, including:

  • Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock),
  • Mod3 (CapsLock), Mod4, Mod5 (Scroll).
  • The release modifier catches release events instead of press events,
  • By default, some modifiers are ignored by xbindkeys, including NumLock, CapsLock and ScrollLock.

For Multiple Keys

xbindkey -mk

NOTE: Wait for the popup window to show, and then press a key.

  • Continue pressing other keys as required.
  • Press q to quit.
ubuntu/mouse/map_mouse_buttons_to_arbitrary_functions/identify_the_key_codes_to_use.txt · Last modified: 2021/10/26 01:17 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki