From fdc77da2ba02ff78b23fc129ec7ee20c0fa28afb Mon Sep 17 00:00:00 2001 From: MDN Date: Thu, 9 Sep 2021 00:49:39 +0000 Subject: [CRON] sync translated content --- files/ru/web/api/uievent/which/index.html | 98 +++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 files/ru/web/api/uievent/which/index.html (limited to 'files/ru/web/api/uievent') diff --git a/files/ru/web/api/uievent/which/index.html b/files/ru/web/api/uievent/which/index.html new file mode 100644 index 0000000000..3c2fc530cc --- /dev/null +++ b/files/ru/web/api/uievent/which/index.html @@ -0,0 +1,98 @@ +--- +title: KeyboardEvent.which +slug: Web/API/UIEvent/which +tags: + - API + - DOM + - Deprecated + - Property + - Reference +translation_of: Web/API/KeyboardEvent/which +original_slug: Web/API/KeyboardEvent/which +--- +
{{APIRef ("События DOM")}} {{Deprecated_header}}
+Свойство which только для чтения интерфейса {{domxref ("KeyboardEvent")}} возвращает числовой код клавиши нажатой клавиши или код символа (charCode) для нажатой буквенно-цифровой клавиши.
+ + + +

Синтаксис

+ +
var keyResult = event.which;
+
+ +

Параметры

+ + + +

Примеры

+ +
<html>
+<head>
+<title>charCode/keyCode/which example</title>
+
+<script type="text/javascript">
+
+function showKeyPress(evt) {
+alert("onkeypress handler: \n"
+      + "keyCode property: " + evt.keyCode + "\n"
+      + "which property: " + evt.which + "\n"
+      + "charCode property: " + evt.charCode + "\n"
+      + "Character Key Pressed: "
+      + String.fromCharCode(evt.charCode) + "\n"
+     );
+}
+
+
+function keyDown(evt) {
+alert("onkeydown handler: \n"
+      + "keyCode property: " + evt.keyCode + "\n"
+      + "which property: " + evt.which + "\n"
+     );
+}
+
+</script>
+</head>
+
+<body
+ onkeypress="showKeyPress(event);"
+ onkeydown="keyDown(event);"
+>
+
+<p>Please press any key.</p>
+
+</body>
+</html>
+
+ +

Спецификации

+ + + + + + + + + + + + + + + + +
СпецификацияСтатусКомментарий
{{SpecName('DOM3 Events','#legacy-interface-KeyboardEvent','KeyboardEvent.which')}}{{Spec2('DOM3 Events')}}Initial definition; specified as deprecated
+ +

Browser compatibility

+ + + +

{{Compat("api.KeyboardEvent.which")}}

+ +

See also

+ + -- cgit v1.2.3-54-g00ecf