You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
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
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user