mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
ui: Add comments
This commit is contained in:
parent
a073f48faf
commit
b56061281d
@ -325,6 +325,7 @@ func init() {
|
|||||||
canvas.Get("style").Set("outline", "none")
|
canvas.Get("style").Set("outline", "none")
|
||||||
|
|
||||||
// Keyboard
|
// Keyboard
|
||||||
|
// Don't 'preventDefault' on keydown events or keypress events wouldn't work (#715).
|
||||||
canvas.Call("addEventListener", "keydown", js.NewEventCallback(0, input.OnKeyDown))
|
canvas.Call("addEventListener", "keydown", js.NewEventCallback(0, input.OnKeyDown))
|
||||||
canvas.Call("addEventListener", "keypress", js.NewEventCallback(js.PreventDefault, input.OnKeyPress))
|
canvas.Call("addEventListener", "keypress", js.NewEventCallback(js.PreventDefault, input.OnKeyPress))
|
||||||
canvas.Call("addEventListener", "keyup", js.NewEventCallback(js.PreventDefault, input.OnKeyUp))
|
canvas.Call("addEventListener", "keyup", js.NewEventCallback(js.PreventDefault, input.OnKeyUp))
|
||||||
|
Loading…
Reference in New Issue
Block a user