admin管理员组文章数量:1131246
Which is the key on the keyboard having the keycode as 13
?
switch(key) {
case 37:
$.keynav.goLeft();
break;
case 38:
$.keynav.goUp();
break;
case 39:
$.keynav.goRight();
break;
case 40:
$.keynav.goDown();
break;
case 13:
$.keynav.activate();
break;
}
Which is the key on the keyboard having the keycode as 13
?
switch(key) {
case 37:
$.keynav.goLeft();
break;
case 38:
$.keynav.goUp();
break;
case 39:
$.keynav.goRight();
break;
case 40:
$.keynav.goDown();
break;
case 13:
$.keynav.activate();
break;
}
Share
Improve this question
edited Jun 19, 2014 at 22:26
017Bluefield
1612 silver badges13 bronze badges
asked May 22, 2011 at 7:42
RoadrunnerRoadrunner
1,7432 gold badges11 silver badges7 bronze badges
1
|
9 Answers
Reset to default 235It's the Return or Enter key on keyboard.
That would be the Enter key.
Check an ASCII table.
It stands for CR
, or Carriage Return, AKA the Return key.
Keycode 13 is the Enter key
Which keycode for escape key with jQuery
The Enter key should have the keycode 13. Is it not working?
Keycode 13 means the Enter key.
If you would want to get more keycodes and what the key the key is, go to: https://keycode.info
key 13 keycode is for ENTER key.
function myFunction(event) {
var x = event.charCode;
document.getElementById("demo").innerHTML = "The Unicode value is: " + x;
}
<p>Keycode 13 is: </p>
<button>Enter</button>
<p>Press a key on the keyboard in the input field to get the Unicode character code of the pressed key.</p>
<b>You can test in below</b>
<input type="text" size="40" onkeypress="myFunction(event)">
<p id="demo"></p>
<p><strong>Note:</strong> The charCode property is not supported in IE8 and earlier versions.</p>
Working for me. Using "@testing-library/react": "^12.1.2"
本文标签: javascriptkeycode 13 is for which keyStack Overflow
版权声明:本文标题:javascript - keycode 13 is for which key - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736760294a1951506.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
key
variable in thisswitch
is eithere.which
ore.keyCode
. Those two are deprecated, so you should usee.key
instead, which will also make your code more readable by turning those numbers into descriptive strings:ArrayUp
,ArrowRight
,ArrowDown
,ArrowLeft
andEnter
. You can check out the key codes and identifiers for any key by just pressing them on this site: keyjs.dev – Danziger Commented Sep 27, 2020 at 7:43