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