From 980fe00a74a9ad013b945755415ace2e5429c3c2 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Wed, 27 Oct 2021 02:31:24 +0300 Subject: [RU] Remove notranslate (#2874) --- files/ru/web/guide/user_input_methods/index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'files/ru/web/guide/user_input_methods') diff --git a/files/ru/web/guide/user_input_methods/index.html b/files/ru/web/guide/user_input_methods/index.html index 8273c220e7..7fecabebd2 100644 --- a/files/ru/web/guide/user_input_methods/index.html +++ b/files/ru/web/guide/user_input_methods/index.html @@ -45,7 +45,7 @@ translation_of: Web/Guide/User_input_methods

Keyboard input can be controlled by your app. For example if you want to add controls when any key gets pressed, you need to add an event listener on the window object:

-
window.addEventListener("keydown", handleKeyDown, true);
+
window.addEventListener("keydown", handleKeyDown, true);
 window.addEventListener("keyup", handleKeyUp, true);

where handleKeyDown and handleKeyUp are the functions implementing the controls about the keydown and keyup events.

@@ -66,7 +66,7 @@ window.addEventListener("keyup", handleKeyUp, true);

If you want to use touch events, you need to add event listeners and specify handler functions, which will be called when the event gets fired:

-
element.addEventListener("touchstart", handleStart, false);
+
element.addEventListener("touchstart", handleStart, false);
 element.addEventListener("touchcancel", handleCancel, false);
 element.addEventListener("touchend", handleEnd, false);
 element.addEventListener("touchmove", handleMove, false);
@@ -93,7 +93,7 @@ element.addEventListener("touchmove", handleMove, false);

This is the code to request pointer lock on an element:

-
element.requestPointerLock();
+
element.requestPointerLock();

Note: For a full tutorial and reference, read our {{domxref("Pointer_Lock_API")}} page.

@@ -113,7 +113,7 @@ element.addEventListener("touchmove", handleMove, false);

You might need to present an element of your application (such as a {{ htmlelement("video") }}, for example) in fullscreen mode. You can achieve this by calling {{domxref("Element.requestFullscreen()")}} on that element. Bear in mind that many browsers still implement this with a vendor prefix, so you will probably need to fork your code something like this:

-
var elem = document.getElementById("myvideo");
+
var elem = document.getElementById("myvideo");
 if (elem.requestFullscreen) {
   elem.requestFullscreen();
 } else if (elem.msRequestFullscreen) {
@@ -134,7 +134,7 @@ if (elem.requestFullscreen) {
 
 

Here is an example that allows a section of content to be dragged.

-
<div draggable="true" ondragstart="event.dataTransfer.setData('text/plain', 'This text may be dragged')">
+
<div draggable="true" ondragstart="event.dataTransfer.setData('text/plain', 'This text may be dragged')">
     This text <strong>may</strong> be dragged.
 
</div>
@@ -153,7 +153,7 @@ if (elem.requestFullscreen) {

In open web apps any DOM element can be made directly editable using the contenteditable attribute.

-
<div contenteditable="true">
+
<div contenteditable="true">
     This text can be edited by the user.
 </div>
-- cgit v1.2.3-54-g00ecf