From b56061281d356149d960cb7608065d4fa9dd7ed6 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 13 Oct 2018 22:41:21 +0900 Subject: [PATCH] ui: Add comments --- internal/ui/ui_js.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/ui/ui_js.go b/internal/ui/ui_js.go index ca17b0a87..9986ce8ff 100644 --- a/internal/ui/ui_js.go +++ b/internal/ui/ui_js.go @@ -325,6 +325,7 @@ func init() { canvas.Get("style").Set("outline", "none") // 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", "keypress", js.NewEventCallback(js.PreventDefault, input.OnKeyPress)) canvas.Call("addEventListener", "keyup", js.NewEventCallback(js.PreventDefault, input.OnKeyUp))