mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
input: Add KeyNumLock (#580)
This commit is contained in:
parent
5229e5a713
commit
dd6110fbf8
@ -69,6 +69,7 @@ func init() {
|
||||
"Backslash": {"Backslash"},
|
||||
"RightBracket": {"BracketRight"},
|
||||
"GraveAccent": {"Backquote"},
|
||||
"NumLock": {"NumLock"},
|
||||
}
|
||||
// ASCII: 0 - 9
|
||||
for c := '0'; c <= '9'; c++ {
|
||||
|
@ -103,6 +103,7 @@ const (
|
||||
KeyLeft
|
||||
KeyLeftBracket
|
||||
KeyMinus
|
||||
KeyNumLock
|
||||
KeyPageDown
|
||||
KeyPageUp
|
||||
KeyPeriod
|
||||
|
@ -108,6 +108,7 @@ var glfwKeyCodeToKey = map[glfw.Key]Key{
|
||||
glfw.KeyLeft: KeyLeft,
|
||||
glfw.KeyLeftBracket: KeyLeftBracket,
|
||||
glfw.KeyMinus: KeyMinus,
|
||||
glfw.KeyNumLock: KeyNumLock,
|
||||
glfw.KeyPageDown: KeyPageDown,
|
||||
glfw.KeyPageUp: KeyPageUp,
|
||||
glfw.KeyPeriod: KeyPeriod,
|
||||
|
@ -235,6 +235,9 @@ var keyToCodes = map[Key][]string{
|
||||
KeyN: {
|
||||
"KeyN",
|
||||
},
|
||||
KeyNumLock: {
|
||||
"NumLock",
|
||||
},
|
||||
KeyO: {
|
||||
"KeyO",
|
||||
},
|
||||
|
3
keys.go
3
keys.go
@ -113,6 +113,7 @@ const (
|
||||
KeyLeft Key = Key(input.KeyLeft)
|
||||
KeyLeftBracket Key = Key(input.KeyLeftBracket)
|
||||
KeyMinus Key = Key(input.KeyMinus)
|
||||
KeyNumLock Key = Key(input.KeyNumLock)
|
||||
KeyPageDown Key = Key(input.KeyPageDown)
|
||||
KeyPageUp Key = Key(input.KeyPageUp)
|
||||
KeyPeriod Key = Key(input.KeyPeriod)
|
||||
@ -297,6 +298,8 @@ func keyNameToKey(name string) (Key, bool) {
|
||||
return KeyLeftBracket, true
|
||||
case "minus":
|
||||
return KeyMinus, true
|
||||
case "numlock":
|
||||
return KeyNumLock, true
|
||||
case "pagedown":
|
||||
return KeyPageDown, true
|
||||
case "pageup":
|
||||
|
Loading…
Reference in New Issue
Block a user