mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
input: Refactoring
This commit is contained in:
parent
682f454fc2
commit
6faad68931
30
genkeys.go
30
genkeys.go
@ -84,6 +84,13 @@ func init() {
|
|||||||
"RightAlt": glfw.KeyRightAlt,
|
"RightAlt": glfw.KeyRightAlt,
|
||||||
"RightSuper": glfw.KeyRightSuper,
|
"RightSuper": glfw.KeyRightSuper,
|
||||||
"Menu": glfw.KeyMenu,
|
"Menu": glfw.KeyMenu,
|
||||||
|
"KPDecimal": glfw.KeyKPDecimal,
|
||||||
|
"KPDivide": glfw.KeyKPDivide,
|
||||||
|
"KPMultiply": glfw.KeyKPMultiply,
|
||||||
|
"KPSubtract": glfw.KeyKPSubtract,
|
||||||
|
"KPAdd": glfw.KeyKPAdd,
|
||||||
|
"KPEnter": glfw.KeyKPEnter,
|
||||||
|
"KPEqual": glfw.KeyKPEqual,
|
||||||
"Last": glfw.KeyLast,
|
"Last": glfw.KeyLast,
|
||||||
}
|
}
|
||||||
nameToJSKey = map[string]string{
|
nameToJSKey = map[string]string{
|
||||||
@ -125,6 +132,13 @@ func init() {
|
|||||||
"PrintScreen": "PrintScreen",
|
"PrintScreen": "PrintScreen",
|
||||||
"ScrollLock": "ScrollLock",
|
"ScrollLock": "ScrollLock",
|
||||||
"Menu": "ContextMenu",
|
"Menu": "ContextMenu",
|
||||||
|
"KPDecimal": "NumpadDecimal",
|
||||||
|
"KPDivide": "NumpadDivide",
|
||||||
|
"KPMultiply": "NumpadMultiply",
|
||||||
|
"KPSubtract": "NumpadSubtract",
|
||||||
|
"KPAdd": "NumpadAdd",
|
||||||
|
"KPEnter": "NumpadEnter",
|
||||||
|
"KPEqual": "NumpadEqual",
|
||||||
}
|
}
|
||||||
// ASCII: 0 - 9
|
// ASCII: 0 - 9
|
||||||
for c := '0'; c <= '9'; c++ {
|
for c := '0'; c <= '9'; c++ {
|
||||||
@ -149,22 +163,6 @@ func init() {
|
|||||||
nameToGLFWKey[name] = glfw.KeyKP0 + glfw.Key(c) - '0'
|
nameToGLFWKey[name] = glfw.KeyKP0 + glfw.Key(c) - '0'
|
||||||
nameToJSKey[name] = "Numpad" + string(c)
|
nameToJSKey[name] = "Numpad" + string(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
nameToGLFWKey["KPDecimal"] = glfw.KeyKPDecimal
|
|
||||||
nameToGLFWKey["KPDivide"] = glfw.KeyKPDivide
|
|
||||||
nameToGLFWKey["KPMultiply"] = glfw.KeyKPMultiply
|
|
||||||
nameToGLFWKey["KPSubtract"] = glfw.KeyKPSubtract
|
|
||||||
nameToGLFWKey["KPAdd"] = glfw.KeyKPAdd
|
|
||||||
nameToGLFWKey["KPEnter"] = glfw.KeyKPEnter
|
|
||||||
nameToGLFWKey["KPEqual"] = glfw.KeyKPEqual
|
|
||||||
|
|
||||||
nameToJSKey["KPDecimal"] = "NumpadDecimal"
|
|
||||||
nameToJSKey["KPDivide"] = "NumpadDivide"
|
|
||||||
nameToJSKey["KPMultiply"] = "NumpadMultiply"
|
|
||||||
nameToJSKey["KPSubtract"] = "NumpadSubtract"
|
|
||||||
nameToJSKey["KPAdd"] = "NumpadAdd"
|
|
||||||
nameToJSKey["KPEnter"] = "NumpadEnter"
|
|
||||||
nameToJSKey["KPEqual"] = "NumpadEqual"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
Loading…
Reference in New Issue
Block a user