{
    "content": [
        {
            "type": "text",
            "text": "# setkeycodes (man)\n\n## NAME\n\nsetkeycodes - load kernel scancode-to-keycode mapping table entries\n\n## SYNOPSIS\n\nsetkeycodes scancode keycode ...\n\n## DESCRIPTION\n\nThe  setkeycodes command reads its arguments two at a time, each pair of arguments consisting\nof a scancode (given in hexadecimal) and a keycode (given in decimal). For each such pair, it\ntells the kernel keyboard driver to map the specified scancode to the specified keycode.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **THEORY** (1 subsections)\n- **OPTIONS**\n- **BUGS**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "setkeycodes",
        "section": "",
        "mode": "man",
        "summary": "setkeycodes - load kernel scancode-to-keycode mapping table entries",
        "synopsis": "setkeycodes scancode keycode ...",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "dumpkeys",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/dumpkeys/1/json"
            },
            {
                "name": "loadkeys",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/loadkeys/1/json"
            },
            {
                "name": "showkey",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/showkey/1/json"
            },
            {
                "name": "getkeycodes",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/getkeycodes/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "THEORY",
                "lines": 17,
                "subsections": [
                    {
                        "name": "2.6 KERNELS",
                        "lines": 6
                    }
                ]
            },
            {
                "name": "OPTIONS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "setkeycodes - load kernel scancode-to-keycode mapping table entries\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "setkeycodes scancode keycode ...\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The  setkeycodes command reads its arguments two at a time, each pair of arguments consisting\nof a scancode (given in hexadecimal) and a keycode (given in decimal). For each such pair, it\ntells the kernel keyboard driver to map the specified scancode to the specified keycode.\n\nThis  command is useful only for people with slightly unusual keyboards, that have a few keys\nwhich produce scancodes that the kernel does not recognize.\n\n",
                "subsections": []
            },
            "THEORY": {
                "content": "The usual PC keyboard produces a series of scancodes for each  key  press  and  key  release.\n(Scancodes  are  shown by showkey -s, see showkey(1) ) The kernel parses this stream of scan‐\ncodes, and converts it to a stream of keycodes (key  press/release  events).   (Keycodes  are\nshown  by  showkey.)  Apart from a few scancodes with special meaning, and apart from the se‐\nquence produced by the Pause key, and apart from shiftstate related scancodes, and apart from\nthe  key up/down bit, the stream of scancodes consists of unescaped scancodes xx (7 bits) and\nescaped scancodes e0 xx (8+7 bits).  To these scancodes or scancode  pairs,  a  corresponding\nkeycode can be assigned (in the range 1-127).  For example, if you have a Macro key that pro‐\nduces e0 6f according to showkey(1), the command\nsetkeycodes e06f 112\nwill assign the keycode 112 to it, and then loadkeys(1) can be used to define the function of\nthis key.\n\nSome  older  kernels  might hardwire a low scancode range to the equivalent keycodes; setkey‐\ncodes will fail when you try to remap these.\n\n",
                "subsections": [
                    {
                        "name": "2.6 KERNELS",
                        "content": "In 2.6 kernels key codes lie in the range 1-255, instead of 1-127.  (It might be best to con‐\nfine oneself to the range 1-239.)\n\nIn  2.6  kernels  raw  mode,  or scancode mode, is not very raw at all.  The code returned by\nshowkey -s will change after use of setkeycodes.  A kernel bug. See also showkey(1).\n"
                    }
                ]
            },
            "OPTIONS": {
                "content": "None.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "The keycodes of X have nothing to do with those of Linux.  Unusual keys can be  made  visible\nunder Linux, but not under X.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "dumpkeys(1), loadkeys(1), showkey(1), getkeycodes(8)\n\n\n\nkbd                                          8 Nov 1994                               SETKEYCODES(8)",
                "subsections": []
            }
        }
    }
}