{"id":2781,"date":"2022-12-20T15:17:17","date_gmt":"2022-12-20T18:17:17","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/setkeycodes-man8\/"},"modified":"2022-12-20T15:17:17","modified_gmt":"2022-12-20T18:17:17","slug":"setkeycodes-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/setkeycodes-man8\/","title":{"rendered":"SETKEYCODES (man8)"},"content":{"rendered":"<h1 align=\"center\">SETKEYCODES<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#THEORY\">THEORY<\/a><br \/> <a href=\"#2.6 KERNELS\">2.6 KERNELS<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#BUGS\">BUGS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">setkeycodes \u2212 load kernel scancode-to-keycode mapping table entries<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>setkeycodes<\/b> <i>scancode keycode &#8230;<\/i><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>setkeycodes<\/i> command reads its arguments two at a time, each pair of arguments consisting of a scancode (given in hexadecimal) and a keycode (given in decimal). For each such pair, it tells the kernel keyboard driver to map the specified scancode to the specified keycode.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">This command is useful only for people with slightly unusual keyboards, that have a few keys which produce scancodes that the kernel does not recognize.<\/p>\n<h2>THEORY <a name=\"THEORY\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The usual PC keyboard produces a series of scancodes for each key press and key release. (Scancodes are shown by <b>showkey \u2212s<\/b>, see <b>showkey<\/b>(1) ) The kernel parses this stream of scancodes, and converts it to a stream of keycodes (key press\/release events). (Keycodes are shown by <b>showkey<\/b>.) Apart from a few scancodes with special meaning, and apart from the sequence produced by the Pause key, and apart from shiftstate related scancodes, and apart from the key up\/down bit, the stream of scancodes consists of unescaped scancodes xx (7 bits) and escaped scancodes e0 xx (8+7 bits). To these scancodes or scancode pairs, a corresponding keycode can be assigned (in the range 1-127). For example, if you have a Macro key that produces e0 6f according to <b>showkey<\/b>(1), the command<\/p>\n<p style=\"margin-left:22%;\"><b>setkeycodes e06f 112<\/b><\/p>\n<p style=\"margin-left:11%;\">will assign the keycode 112 to it, and then <b>loadkeys<\/b>(1) can be used to define the function of this key.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Some older kernels might hardwire a low scancode range to the equivalent keycodes; setkeycodes will fail when you try to remap these.<\/p>\n<h2>2.6 KERNELS <a name=\"2.6 KERNELS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">In 2.6 kernels key codes lie in the range 1-255, instead of 1-127. (It might be best to confine oneself to the range 1-239.)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In 2.6 kernels raw mode, or scancode mode, is not very raw at all. The code returned by showkey \u2212s will change after use of setkeycodes. A kernel bug. See also <b>showkey<\/b>(1).<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">None.<\/p>\n<h2>BUGS <a name=\"BUGS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The keycodes of X have nothing to do with those of Linux. Unusual keys can be made visible under Linux, but not under X.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>dumpkeys<\/b>(1), <b>loadkeys<\/b>(1), <b>showkey<\/b>(1), <b>getkeycodes<\/b>(8)<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  setkeycodes \u2212 load kernel scancode-to-keycode mapping table entries <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,135],"class_list":["post-2781","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-setkeycodes"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/2781","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=2781"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/2781\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=2781"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=2781"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=2781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}