ui: Add more keys not for charCode

This commit is contained in:
Hajime Hoshi 2017-11-10 00:46:37 +09:00
parent fb8bef99c3
commit 4b83a060fe

View File

@ -250,7 +250,9 @@ func initialize() error {
if keyCodeToKeyEdge[code] == KeyUp ||
keyCodeToKeyEdge[code] == KeyDown ||
keyCodeToKeyEdge[code] == KeyLeft ||
keyCodeToKeyEdge[code] == KeyRight {
keyCodeToKeyEdge[code] == KeyRight ||
keyCodeToKeyEdge[code] == KeyBackspace ||
keyCodeToKeyEdge[code] == KeyTab {
e.Call("preventDefault")
}
currentInput.keyDownEdge(code)
@ -260,7 +262,9 @@ func initialize() error {
if cs == keyToCodes[KeyUp][0] ||
cs == keyToCodes[KeyDown][0] ||
cs == keyToCodes[KeyLeft][0] ||
cs == keyToCodes[KeyRight][0] {
cs == keyToCodes[KeyRight][0] ||
cs == keyToCodes[KeyBackspace][0] ||
cs == keyToCodes[KeyTab][0] {
e.Call("preventDefault")
}
currentInput.keyDown(cs)