diff options
author | L. Krause <eska@eska.me> | 2017-07-22 15:43:05 +0200 |
---|---|---|
committer | L. Krause <eska@eska.me> | 2017-07-22 17:25:15 +0200 |
commit | ca28c068c0dc6a95a60e5a70ce00d75f9b6f37a0 (patch) | |
tree | cc8903689f1227781e021bce668deac49dd22390 /platform/javascript/godot_shell.html | |
parent | e4dc52ba81c4682b4688bd23def41554a4aa82b2 (diff) |
Implement input focus behavior in HTML5
- Key and mouse events are only consumed if canvas is focused
- NOTIFICATION_WM_MOUSE_ENTER, _MOUSE_EXIT, _FOCUS_IN and _FOCUS_OUT are
emitted
Diffstat (limited to 'platform/javascript/godot_shell.html')
-rw-r--r-- | platform/javascript/godot_shell.html | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/javascript/godot_shell.html b/platform/javascript/godot_shell.html index 6c7069a8f0..ee7399a129 100644 --- a/platform/javascript/godot_shell.html +++ b/platform/javascript/godot_shell.html @@ -83,6 +83,10 @@ color: white; } + #canvas:focus { + outline: none; + } + /* Status display * ============== */ @@ -147,7 +151,7 @@ $GODOT_HEAD_INCLUDE </head> <body> <div id="container"> - <canvas id="canvas" width="640" height="480" onclick="canvas.ownerDocument.defaultView.focus();" oncontextmenu="event.preventDefault();"> + <canvas id="canvas" width="640" height="480" tabindex="0" oncontextmenu="event.preventDefault();"> HTML5 canvas appears to be unsupported in the current browser.<br /> Please try updating or use a different browser. </canvas> |