{"id":62,"date":"2023-08-25T17:38:14","date_gmt":"2023-08-25T17:38:14","guid":{"rendered":"\/\/api.jqueryui.com\/1.10\/?p=62"},"modified":"2023-08-25T17:38:14","modified_gmt":"2023-08-25T17:38:14","slug":"jQuery.ui.keyCode","status":"publish","type":"post","link":"https:\/\/api.jqueryui.com\/1.10\/jQuery.ui.keyCode\/","title":{"rendered":"jQuery.ui.keyCode"},"content":{"rendered":"<article id=\"jQuery-ui-keyCode1\" class=\"entry property\"><h2 class=\"section-title\"><span>jQuery.ui.keyCode<\/span><\/h2>\n<div class=\"entry-wrapper\">\n<p class=\"desc\"><strong>Description: <\/strong>A mapping of key code descriptions to their numeric values.<\/p>\n<ul class=\"signatures\"><li class=\"signature\">\n<h4 class=\"name\">jQuery.ui.keyCode<\/h4>\n<ul>\n<li id=\"jQuery.ui.keyCode-BACKSPACE\">\n<div><strong>BACKSPACE<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Integer\">Integer<\/a>\n<\/div>\n<div><\/div>\n<\/li>\n<li id=\"jQuery.ui.keyCode-COMMA\">\n<div><strong>COMMA<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Integer\">Integer<\/a>\n<\/div>\n<div><\/div>\n<\/li>\n<li id=\"jQuery.ui.keyCode-DELETE\">\n<div><strong>DELETE<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Integer\">Integer<\/a>\n<\/div>\n<div><\/div>\n<\/li>\n<li id=\"jQuery.ui.keyCode-DOWN\">\n<div><strong>DOWN<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Integer\">Integer<\/a>\n<\/div>\n<div><\/div>\n<\/li>\n<li id=\"jQuery.ui.keyCode-END\">\n<div><strong>END<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Integer\">Integer<\/a>\n<\/div>\n<div><\/div>\n<\/li>\n<li id=\"jQuery.ui.keyCode-ENTER\">\n<div><strong>ENTER<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Integer\">Integer<\/a>\n<\/div>\n<div><\/div>\n<\/li>\n<li id=\"jQuery.ui.keyCode-ESCAPE\">\n<div><strong>ESCAPE<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Integer\">Integer<\/a>\n<\/div>\n<div><\/div>\n<\/li>\n<li id=\"jQuery.ui.keyCode-HOME\">\n<div><strong>HOME<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Integer\">Integer<\/a>\n<\/div>\n<div><\/div>\n<\/li>\n<li id=\"jQuery.ui.keyCode-LEFT\">\n<div><strong>LEFT<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Integer\">Integer<\/a>\n<\/div>\n<div><\/div>\n<\/li>\n<li id=\"jQuery.ui.keyCode-PAGE_DOWN\">\n<div><strong>PAGE_DOWN<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Integer\">Integer<\/a>\n<\/div>\n<div><\/div>\n<\/li>\n<li id=\"jQuery.ui.keyCode-PAGE_UP\">\n<div><strong>PAGE_UP<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Integer\">Integer<\/a>\n<\/div>\n<div><\/div>\n<\/li>\n<li id=\"jQuery.ui.keyCode-PERIOD\">\n<div><strong>PERIOD<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Integer\">Integer<\/a>\n<\/div>\n<div><\/div>\n<\/li>\n<li id=\"jQuery.ui.keyCode-RIGHT\">\n<div><strong>RIGHT<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Integer\">Integer<\/a>\n<\/div>\n<div><\/div>\n<\/li>\n<li id=\"jQuery.ui.keyCode-SPACE\">\n<div><strong>SPACE<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Integer\">Integer<\/a>\n<\/div>\n<div><\/div>\n<\/li>\n<li id=\"jQuery.ui.keyCode-TAB\">\n<div><strong>TAB<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Integer\">Integer<\/a>\n<\/div>\n<div><\/div>\n<\/li>\n<li id=\"jQuery.ui.keyCode-UP\">\n<div><strong>UP<\/strong><\/div>\n<div>Type: <a href=\"http:\/\/api.jquery.com\/Types\/#Integer\">Integer<\/a>\n<\/div>\n<div><\/div>\n<\/li>\n<\/ul>\n<\/li><\/ul>\n<section class=\"entry-examples\" id=\"entry-examples\"><header><h2>Example:<\/h2><\/header><div class=\"entry-example\" id=\"example-0\">\n<p>Test for arrow key presses.<\/p>\n<div class=\"syntaxhighlighter javascript\">\n\t<table>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t\n\t\t\t\t<td class=\"gutter\">\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n1\">1<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n2\">2<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n3\">3<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n4\">4<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n5\">5<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n6\">6<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n7\">7<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n8\">8<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n9\">9<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n10\">10<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n11\">11<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n12\">12<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n13\">13<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n14\">14<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n15\">15<\/div>\n\t\t\t\t\t\n\t\t\t\t\t\t<div class=\"line n16\">16<\/div>\n\t\t\t\t\t\n\t\t\t\t<\/td>\n\t\t\t\t\n\t\t\t\t<td class=\"code\">\n\t\t\t\t\t<pre><div class=\"container\"><div class=\"line\"><code>$( <span class=\"hljs-built_in\">document<\/span> ).on( <span class=\"hljs-string\">&quot;keydown&quot;<\/span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span>(<span class=\"hljs-params\"> event <\/span>) <\/span>{<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>  <span class=\"hljs-keyword\">switch<\/span>( event.keyCode ) {<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>    <span class=\"hljs-keyword\">case<\/span> $.ui.keyCode.LEFT:<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>      <span class=\"hljs-built_in\">console<\/span>.log( <span class=\"hljs-string\">&quot;left&quot;<\/span> );<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>      <span class=\"hljs-keyword\">break<\/span>;<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>    <span class=\"hljs-keyword\">case<\/span> $.ui.keyCode.RIGHT:<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>      <span class=\"hljs-built_in\">console<\/span>.log( <span class=\"hljs-string\">&quot;right&quot;<\/span> );<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>      <span class=\"hljs-keyword\">break<\/span>;<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>    <span class=\"hljs-keyword\">case<\/span> $.ui.keyCode.UP:<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>      <span class=\"hljs-built_in\">console<\/span>.log( <span class=\"hljs-string\">&quot;up&quot;<\/span> );<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>      <span class=\"hljs-keyword\">break<\/span>;<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>    <span class=\"hljs-keyword\">case<\/span> $.ui.keyCode.DOWN:<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>      <span class=\"hljs-built_in\">console<\/span>.log( <span class=\"hljs-string\">&quot;down&quot;<\/span> );<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>      <span class=\"hljs-keyword\">break<\/span>;<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>  }<\/code><\/div><\/div><div class=\"container\"><div class=\"line\"><code>});<\/code><\/div><\/div><\/pre>\n\t\t\t\t<\/td>\n\t\t\t<\/tr>\n\t\t<\/tbody>\n\t<\/table>\n<\/div>\n\n<\/div><\/section>\n<\/div><\/article>","protected":false},"excerpt":{"rendered":"<p>A mapping of key code descriptions to their numeric values.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-62","post","type-post","status-publish","format-standard","hentry","category-ui-core"],"_links":{"self":[{"href":"https:\/\/api.jqueryui.com\/1.10\/wp-json\/wp\/v2\/posts\/62","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/api.jqueryui.com\/1.10\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/api.jqueryui.com\/1.10\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/api.jqueryui.com\/1.10\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/api.jqueryui.com\/1.10\/wp-json\/wp\/v2\/comments?post=62"}],"version-history":[{"count":1,"href":"https:\/\/api.jqueryui.com\/1.10\/wp-json\/wp\/v2\/posts\/62\/revisions"}],"predecessor-version":[{"id":63,"href":"https:\/\/api.jqueryui.com\/1.10\/wp-json\/wp\/v2\/posts\/62\/revisions\/63"}],"wp:attachment":[{"href":"https:\/\/api.jqueryui.com\/1.10\/wp-json\/wp\/v2\/media?parent=62"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/api.jqueryui.com\/1.10\/wp-json\/wp\/v2\/categories?post=62"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/api.jqueryui.com\/1.10\/wp-json\/wp\/v2\/tags?post=62"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}