{
    "mode": "info",
    "parameter": "KEYMAPS",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/KEYMAPS/json",
    "generated": "2026-07-07T02:38:40Z",
    "sections": {
        "NAME": {
            "content": "keymaps - keyboard table descriptions for loadkeys and dumpkeys\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "These  files  are  used by loadkeys(1) to modify the translation tables\nused by the kernel keyboard driver and generated  by  dumpkeys(1)  from\nthose translation tables.\n\nThe  format  of  these  files is vaguely similar to the one accepted by\nxmodmap(1).  The file consists of charset or key or  string  definition\nlines interspersed with comments.\n\nComments are introduced with !  or # characters and continue to the end\nof the line. Anything following one of these characters on that line is\nignored.  Note  that  comments  need  not begin from column one as with\nxmodmap(1).\n\nThe syntax of keymap files is line oriented; a complete definition must\nfit on a single logical line. Logical lines can, however, be split into\nmultiple physical lines by ending each subline with the backslash char-\nacter (\\).\n",
            "subsections": []
        },
        "INCLUDE FILES": {
            "content": "A keymap can include other keymaps using the syntax\n\ninclude \"pathname\"\n",
            "subsections": []
        },
        "CHARSET DEFINITIONS": {
            "content": "A character set definition line is of the form:\n\ncharset \"iso-8859-x\"\n\nIt  defines  how following keysyms are to be interpreted.  For example,\nin iso-8859-1 the  symbol  mu  (or  micro)  has  code  0265,  while  in\niso-8859-7 the letter mu has code 0354.\n",
            "subsections": []
        },
        "COMPLETE KEYCODE DEFINITIONS": {
            "content": "Each complete key definition line is of the form:\n\nkeycode keynumber = keysym keysym keysym...\n\nkeynumber  is  the  internal  identification number of the key, roughly\nequivalent to the scan code of it.  keynumber can be given in  decimal,\noctal  or hexadecimal notation.  Octal is denoted by a leading zero and\nhexadecimal by the prefix 0x.\n\nEach of the keysyms represent keyboard actions, of which up to 256  can\nbe  bound  to  a  single  key. The actions available include outputting\ncharacter codes or character sequences, switching consoles or  keymaps,\nbooting  the machine etc. (The complete list can be obtained from dump-\nkeys(1) by saying  dumpkeys -l .)\n\nEach keysym may be prefixed by a '+' (plus sign),  in  wich  case  this\nkeysym  is  treated  as  a \"letter\" and therefore affected by the \"Cap-\nsLock\" the same way as by \"Shift\" (to be correct, the CapsLock  inverts\nthe  Shift  state).   The  ASCII letters ('a'-'z' and 'A'-'Z') are made\nCapsLock'able by default.  If Shift+CapsLock should not produce a lower\ncase symbol, put lines like\n\nkeycode 30 = +a  A\n\nin the map file.\n\nWhich  of  the actions bound to a given key is taken when it is pressed\ndepends on what modifiers are in effect at that moment.   The  keyboard\ndriver  supports  9  modifiers. These modifiers are labeled (completely\narbitrarily) Shift, AltGr, Control, Alt, ShiftL, ShiftR,  CtrlL,  CtrlR\nand  CapsShift.   Each  of  these modifiers has an associated weight of\npower of two according to the following table:\n\nmodifier            weight\n\nShift                  1\nAltGr                  2\nControl                4\nAlt                    8\nShiftL                16\nShiftR                32\nCtrlL                 64\nCtrlR                128\nCapsShift            256\n\nThe effective action of a key is found out by adding up the weights  of\nall the modifiers in effect. By default, no modifiers are in effect, so\naction number zero, i.e. the one in the first column in a  key  defini-\ntion  line,  is  taken  when  the key is pressed or released. When e.g.\nShift and Alt modifiers are in effect, action  number  nine  (from  the\n10th column) is the effective one.\n\nChanging  the  state of what modifiers are in effect can be achieved by\nbinding appropriate key actions to desired keys. For  example,  binding\nthe  symbol  Shift to a key sets the Shift modifier in effect when that\nkey is pressed and cancels the effect of that modifier when the key  is\nreleased. Binding AltGrLock to a key sets AltGr in effect when the key\nis pressed and cancels the effect when the key is pressed  again.   (By\ndefault Shift, AltGr, Control and Alt are bound to the keys that bear a\nsimilar label; AltGr may denote the right Alt key.)\n\nNote that you should be very careful when binding  the  modifier  keys,\notherwise  you can end up with an unusable keyboard mapping. If you for\nexample define a key to have Control in its first column and leave  the\nrest  of  the columns to be VoidSymbols, you're in trouble. This is be-\ncause pressing the key puts Control modifier in effect and the  follow-\ning  actions are looked up from the fifth column (see the table above).\nSo, when you release the key, the  action  from  the  fifth  column  is\ntaken. It has VoidSymbol in it, so nothing happens. This means that the\nControl modifier is still in effect, although  you  have  released  the\nkey.   Re-pressing  and releasing the key has no effect. To avoid this,\nyou should always define all the columns to have the same modifier sym-\nbol. There is a handy short-hand notation for this, see below.\n\nkeysyms  can  be  given in decimal, octal, hexadecimal, unicode or sym-\nbolic notation.  The numeric notations use  the  same  format  as  with\nkeynumber.   Unicode notation is \"U+\" followed by four hexadecimal dig-\nits.  The symbolic notation resembles that used by xmodmap(1).  Notable\ndifferences  are  the number symbols. The numeric symbols '0', ..., '9'\nof xmodmap(1) are replaced with the corresponding words 'zero',  'one',\n... 'nine' to avoid confusion with the numeric notation.\n\nIt  should  be  noted  that  using  numeric notation for the keysyms is\nhighly unportable as the key action numbers may vary  from  one  kernel\nversion  to  another  and the use of numeric notations is thus strongly\ndiscouraged. They are intended to be used only when you know there is a\nsupported keyboard action in your kernel for which your current version\nof loadkeys(1) has no symbolic name.\n\nThere is a number of short-hand notations to add readability and reduce\ntyping work and the probability of typing-errors.\n\nFirst of all, you can give a map specification line, of the form\n\nkeymaps 0-2,4-5,8,12\n\nto  indicate that the lines of the keymap will not specify all 256 col-\numns, but only the indicated ones. (In the  example:  only  the  plain,\nShift,  AltGr,  Control,  Control+Shift, Alt and Control+Alt maps, that\nis, 7 columns instead of 256.)  When no such line is given, the keymaps\n0-M  will  be defined, where M+1 is the maximum number of entries found\nin any definition line.\n\nNext, you can leave off any trailing VoidSymbol entries from a key def-\ninition  line.  VoidSymbol  denotes a keyboard action which produces no\noutput and has no other effects either. For example, to define key num-\nber  30  to  output  'a'  unshifted, 'A' when pressed with Shift and do\nnothing when pressed with AltGr or other modifiers, you can write\n\nkeycode  30 = a     A\n\ninstead of the more verbose\n\nkeycode  30 = a     A    VoidSymbol     VoidSymbol \\\nVoidSymbol VoidSymbol VoidSymbol ...\n\nFor added convenience, you can usually get off with  still  more  terse\ndefinitions.  If  you enter a key definition line with only and exactly\none action code after the equals sign, it has a special meaning. If the\ncode (numeric or symbolic) is not an ASCII letter, it means the code is\nimplicitly replicated through all columns being defined.   If,  on  the\nother  hand,  the  action  code is an ASCII character in the range 'a',\n..., 'z' or 'A', ..., 'Z' in the ASCII collating sequence, the  follow-\ning  definitions are made for the different modifier combinations, pro-\nvided these are actually being defined.  (The table lists the two  pos-\nsible  cases: either the single action code is a lower case letter, de-\nnoted by 'x' or an upper case letter, denoted by 'Y'.)\n\nmodifier                symbol\n\nnone                    x              Y\nShift                   X              y\nAltGr                   x              Y\nShift+AltGr             X              y\nControl                 Controlx      Controly\nShift+Control           Controlx      Controly\nAltGr+Control           Controlx      Controly\nShift+AltGr+Control     Controlx      Controly\nAlt                     Metax         MetaY\nShift+Alt               MetaX         Metay\nAltGr+Alt               Metax         MetaY\nShift+AltGr+Alt         MetaX         Metay\nControl+Alt             MetaControlx MetaControly\nShift+Control+Alt       MetaControlx MetaControly\nAltGr+Control+Alt       MetaControlx MetaControly\nShift+AltGr+Control+Alt MetaControlx MetaControly\n",
            "subsections": []
        },
        "SINGLE MODIFIER DEFINITIONS": {
            "content": "All the previous forms of key definition lines always  define  all  the\nM+1  possible modifier combinations being defined, whether the line ac-\ntually contains that many action codes or not.  There  is,  however,  a\nvariation  of the definition syntax for defining only single actions to\na particular modifier combination of a key. This is especially  useful,\nif  you load a keymap which doesn't match your needs in only some modi-\nfier combinations, like AltGr+function keys. You can then make a  small\nlocal  file  redefining only those modifier combinations and loading it\nafter the main file.  The syntax of this form is:\n\n{ plain | <modifier sequence> } keycode keynumber = keysym\n\n, e.g.,\nplain keycode 14 = BackSpace\ncontrol alt keycode 83 = Boot\nalt keycode 105 = DecrConsole\nalt keycode 106 = IncrConsole\nUsing \"plain\" will define only the base entry of a key  (i.e.  the  one\nwith  no  modifiers  in effect) without affecting the bindings of other\nmodifier combinations of that key.\n",
            "subsections": []
        },
        "STRING DEFINITIONS": {
            "content": "In addition to comments and key definition lines, a keymap can  contain\nstring definitions. These are used to define what each function key ac-\ntion code sends. The syntax of string definitions is:\n\nstring keysym = \"text\"\n\ntext can contain literal characters, octal character codes in the  for-\nmat  of  backslash  followed by up to three octal digits, and the three\nescape sequences \\n, \\\\, and \\\", for newline, backslash and quote,  re-\nspectively.\n",
            "subsections": []
        },
        "COMPOSE DEFINITIONS": {
            "content": "Then there may also be compose definitions. They have syntax\n\ncompose 'char' 'char' to 'char'\nand  describe  how  two  bytes are combined to form a third one (when a\ndead accent or compose key is used).  This is used to get accented let-\nters and the like on a standard keyboard.\n",
            "subsections": []
        },
        "ABBREVIATIONS": {
            "content": "Various abbreviations can be used with kbd-0.96 and later.\n\nstrings as usual\nDefines  the  usual values of the strings (but not the keys they\nare bound to).\n\ncompose as usual for \"iso-8859-1\"\nDefines the usual compose combinations.\n\nTo find out what keysyms there are available for use  in  keymaps,  use\nthe command\n\ndumpkeys --long-info\n\nUnfortunately,  there  is  currently no description of what each symbol\ndoes. It has to be guessed from the name or figured out from the kernel\nsources.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "(Be  careful  to use a keymaps line, like the first line of `dumpkeys`,\nor \"keymaps 0-15\" or so.)\n\nThe following entry exchanges the left Control key and  the  Caps  Lock\nkey on the keyboard:\n\nkeycode  58 = Control\nkeycode  29 = CapsLock\n\nKey  number 58 is normally the Caps Lock key, and key number 29 is nor-\nmally the Control key.\n\nThe following entry sets the Shift and Caps Lock keys  to  behave  more\nnicely, like in older typewriters. That is, pressing Caps Lock key once\nor more sets the keyboard in CapsLock state and pressing either of  the\nShift keys releases it.\n\nkeycode  42 = UncapsShift\nkeycode  54 = UncapsShift\nkeycode  58 = CapsOn\n\nThe  following  entry  sets  the layout of the edit pad in the enhanced\nkeyboard to be more like that in the VT200 series terminals:\n\nkeycode 102 = Insert\nkeycode 104 = Remove\nkeycode 107 = Prior\nshift keycode 107 = ScrollBackward\nkeycode 110 = Find\nkeycode 111 = Select\ncontrol alt   keycode 111 = Boot\ncontrol altgr keycode 111 = Boot\n\nHere's an example to bind the string \"du\\ndf\\n\" to the key AltGr-D.  We\nuse the \"spare\" action code F100 not normally bound to any key.\n\naltgr keycode 32 = F100\nstring F100 = \"du\\ndf\\n\"\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "loadkeys(1), dumpkeys(1), showkey(1), xmodmap(1)\n\nkbd                              24 April 1998                      KEYMAPS(5)",
            "subsections": []
        }
    },
    "summary": "keymaps - keyboard table descriptions for loadkeys and dumpkeys",
    "flags": [],
    "examples": [
        "(Be  careful  to use a keymaps line, like the first line of `dumpkeys`,",
        "or \"keymaps 0-15\" or so.)",
        "The following entry exchanges the left Control key and  the  Caps  Lock",
        "key on the keyboard:",
        "keycode  58 = Control",
        "keycode  29 = CapsLock",
        "Key  number 58 is normally the Caps Lock key, and key number 29 is nor-",
        "mally the Control key.",
        "The following entry sets the Shift and Caps Lock keys  to  behave  more",
        "nicely, like in older typewriters. That is, pressing Caps Lock key once",
        "or more sets the keyboard in CapsLock state and pressing either of  the",
        "Shift keys releases it.",
        "keycode  42 = UncapsShift",
        "keycode  54 = UncapsShift",
        "keycode  58 = CapsOn",
        "The  following  entry  sets  the layout of the edit pad in the enhanced",
        "keyboard to be more like that in the VT200 series terminals:",
        "keycode 102 = Insert",
        "keycode 104 = Remove",
        "keycode 107 = Prior",
        "shift keycode 107 = ScrollBackward",
        "keycode 110 = Find",
        "keycode 111 = Select",
        "control alt   keycode 111 = Boot",
        "control altgr keycode 111 = Boot",
        "Here's an example to bind the string \"du\\ndf\\n\" to the key AltGr-D.  We",
        "use the \"spare\" action code F100 not normally bound to any key.",
        "altgr keycode 32 = F100",
        "string F100 = \"du\\ndf\\n\""
    ],
    "see_also": [
        {
            "name": "loadkeys",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/loadkeys/1/json"
        },
        {
            "name": "dumpkeys",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/dumpkeys/1/json"
        },
        {
            "name": "showkey",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/showkey/1/json"
        },
        {
            "name": "xmodmap",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/xmodmap/1/json"
        }
    ]
}