mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
Bug fix: Ignore unknown keys
This commit is contained in:
parent
f78c79a5dd
commit
6bdc875596
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user