Bug fix: Ignore unknown keys

This commit is contained in:
Hajime Hoshi 2015-01-07 23:02:58 +09:00
parent f78c79a5dd
commit 6bdc875596

View File

@ -31,12 +31,18 @@ func CursorPosition() (x, y int) {
}
func (i *input) keyDown(key int) {
k := keyCodeToKey[key]
k, ok := keyCodeToKey[key]
if !ok {
return
}
i.keyPressed[k] = true
}
func (i *input) keyUp(key int) {
k := keyCodeToKey[key]
k, ok := keyCodeToKey[key]
if !ok {
return
}
i.keyPressed[k] = false
}