mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
mobile/ebitenmobileview: Bug fix: Wrong key names
This commit is contained in:
parent
b3c567de89
commit
1dd0c22510
90
genkeys.go
90
genkeys.go
@ -97,51 +97,51 @@ func init() {
|
|||||||
|
|
||||||
// https://developer.android.com/reference/android/view/KeyEvent
|
// https://developer.android.com/reference/android/view/KeyEvent
|
||||||
androidKeyToDriverKeyName = map[int]string{
|
androidKeyToDriverKeyName = map[int]string{
|
||||||
55: "KeyComma",
|
55: "Comma",
|
||||||
56: "KeyPeriod",
|
56: "Period",
|
||||||
57: "KeyLeftAlt",
|
57: "LeftAlt",
|
||||||
58: "KeyRightAlt",
|
58: "RightAlt",
|
||||||
115: "KeyCapsLock",
|
115: "CapsLock",
|
||||||
113: "KeyLeftControl",
|
113: "LeftControl",
|
||||||
114: "KeyRightControl",
|
114: "RightControl",
|
||||||
59: "KeyLeftShift",
|
59: "LeftShift",
|
||||||
60: "KeyRightShift",
|
60: "RightShift",
|
||||||
66: "KeyEnter",
|
66: "Enter",
|
||||||
62: "KeySpace",
|
62: "Space",
|
||||||
61: "KeyTab",
|
61: "Tab",
|
||||||
112: "KeyDelete", // KEYCODE_FORWARD_DEL
|
112: "Delete", // KEYCODE_FORWARD_DEL
|
||||||
123: "KeyEnd",
|
123: "End",
|
||||||
122: "KeyHome",
|
122: "Home",
|
||||||
124: "KeyInsert",
|
124: "Insert",
|
||||||
93: "KeyPageDown",
|
93: "PageDown",
|
||||||
92: "KeyPageUp",
|
92: "PageUp",
|
||||||
20: "KeyDown",
|
20: "Down",
|
||||||
21: "KeyLeft",
|
21: "Left",
|
||||||
22: "KeyRight",
|
22: "Right",
|
||||||
19: "KeyUp",
|
19: "Up",
|
||||||
111: "KeyEscape",
|
111: "Escape",
|
||||||
67: "KeyBackspace", // KEYCODE_DEL
|
67: "Backspace", // KEYCODE_DEL
|
||||||
75: "KeyApostrophe",
|
75: "Apostrophe",
|
||||||
69: "KeyMinus",
|
69: "Minus",
|
||||||
76: "KeySlash",
|
76: "Slash",
|
||||||
74: "KeySemicolon",
|
74: "Semicolon",
|
||||||
70: "KeyEqual",
|
70: "Equal",
|
||||||
71: "KeyLeftBracket",
|
71: "LeftBracket",
|
||||||
73: "KeyBackslash",
|
73: "Backslash",
|
||||||
72: "KeyRightBracket",
|
72: "RightBracket",
|
||||||
68: "KeyGraveAccent",
|
68: "GraveAccent",
|
||||||
143: "KeyNumLock",
|
143: "NumLock",
|
||||||
121: "KeyPause", // KEYCODE_BREAK
|
121: "Pause", // KEYCODE_BREAK
|
||||||
120: "KeyPrintScreen", // KEYCODE_SYSRQ
|
120: "PrintScreen", // KEYCODE_SYSRQ
|
||||||
116: "KeyScrollLock",
|
116: "ScrollLock",
|
||||||
82: "KeyMenu",
|
82: "Menu",
|
||||||
158: "KeyKPDecimal",
|
158: "KPDecimal",
|
||||||
154: "KeyKPDivide",
|
154: "KPDivide",
|
||||||
155: "KeyKPMultiply",
|
155: "KPMultiply",
|
||||||
156: "KeyKPSubtract",
|
156: "KPSubtract",
|
||||||
157: "KeyKPAdd",
|
157: "KPAdd",
|
||||||
160: "KeyKPEnter",
|
160: "KPEnter",
|
||||||
161: "KeyKPEqual",
|
161: "KPEqual",
|
||||||
}
|
}
|
||||||
|
|
||||||
driverKeyNameToJSKey = map[string]string{
|
driverKeyNameToJSKey = map[string]string{
|
||||||
|
@ -31,10 +31,10 @@ var androidKeyToDriverKeyName = map[int]driver.Key{
|
|||||||
14: driver.Key7,
|
14: driver.Key7,
|
||||||
15: driver.Key8,
|
15: driver.Key8,
|
||||||
16: driver.Key9,
|
16: driver.Key9,
|
||||||
19: driver.KeyKeyUp,
|
19: driver.KeyUp,
|
||||||
20: driver.KeyKeyDown,
|
20: driver.KeyDown,
|
||||||
21: driver.KeyKeyLeft,
|
21: driver.KeyLeft,
|
||||||
22: driver.KeyKeyRight,
|
22: driver.KeyRight,
|
||||||
29: driver.KeyA,
|
29: driver.KeyA,
|
||||||
30: driver.KeyB,
|
30: driver.KeyB,
|
||||||
31: driver.KeyC,
|
31: driver.KeyC,
|
||||||
@ -61,39 +61,39 @@ var androidKeyToDriverKeyName = map[int]driver.Key{
|
|||||||
52: driver.KeyX,
|
52: driver.KeyX,
|
||||||
53: driver.KeyY,
|
53: driver.KeyY,
|
||||||
54: driver.KeyZ,
|
54: driver.KeyZ,
|
||||||
55: driver.KeyKeyComma,
|
55: driver.KeyComma,
|
||||||
56: driver.KeyKeyPeriod,
|
56: driver.KeyPeriod,
|
||||||
57: driver.KeyKeyLeftAlt,
|
57: driver.KeyLeftAlt,
|
||||||
58: driver.KeyKeyRightAlt,
|
58: driver.KeyRightAlt,
|
||||||
59: driver.KeyKeyLeftShift,
|
59: driver.KeyLeftShift,
|
||||||
60: driver.KeyKeyRightShift,
|
60: driver.KeyRightShift,
|
||||||
61: driver.KeyKeyTab,
|
61: driver.KeyTab,
|
||||||
62: driver.KeyKeySpace,
|
62: driver.KeySpace,
|
||||||
66: driver.KeyKeyEnter,
|
66: driver.KeyEnter,
|
||||||
67: driver.KeyKeyBackspace,
|
67: driver.KeyBackspace,
|
||||||
68: driver.KeyKeyGraveAccent,
|
68: driver.KeyGraveAccent,
|
||||||
69: driver.KeyKeyMinus,
|
69: driver.KeyMinus,
|
||||||
70: driver.KeyKeyEqual,
|
70: driver.KeyEqual,
|
||||||
71: driver.KeyKeyLeftBracket,
|
71: driver.KeyLeftBracket,
|
||||||
72: driver.KeyKeyRightBracket,
|
72: driver.KeyRightBracket,
|
||||||
73: driver.KeyKeyBackslash,
|
73: driver.KeyBackslash,
|
||||||
74: driver.KeyKeySemicolon,
|
74: driver.KeySemicolon,
|
||||||
75: driver.KeyKeyApostrophe,
|
75: driver.KeyApostrophe,
|
||||||
76: driver.KeyKeySlash,
|
76: driver.KeySlash,
|
||||||
82: driver.KeyKeyMenu,
|
82: driver.KeyMenu,
|
||||||
92: driver.KeyKeyPageUp,
|
92: driver.KeyPageUp,
|
||||||
93: driver.KeyKeyPageDown,
|
93: driver.KeyPageDown,
|
||||||
111: driver.KeyKeyEscape,
|
111: driver.KeyEscape,
|
||||||
112: driver.KeyKeyDelete,
|
112: driver.KeyDelete,
|
||||||
113: driver.KeyKeyLeftControl,
|
113: driver.KeyLeftControl,
|
||||||
114: driver.KeyKeyRightControl,
|
114: driver.KeyRightControl,
|
||||||
115: driver.KeyKeyCapsLock,
|
115: driver.KeyCapsLock,
|
||||||
116: driver.KeyKeyScrollLock,
|
116: driver.KeyScrollLock,
|
||||||
120: driver.KeyKeyPrintScreen,
|
120: driver.KeyPrintScreen,
|
||||||
121: driver.KeyKeyPause,
|
121: driver.KeyPause,
|
||||||
122: driver.KeyKeyHome,
|
122: driver.KeyHome,
|
||||||
123: driver.KeyKeyEnd,
|
123: driver.KeyEnd,
|
||||||
124: driver.KeyKeyInsert,
|
124: driver.KeyInsert,
|
||||||
131: driver.KeyF1,
|
131: driver.KeyF1,
|
||||||
132: driver.KeyF2,
|
132: driver.KeyF2,
|
||||||
133: driver.KeyF3,
|
133: driver.KeyF3,
|
||||||
@ -106,7 +106,7 @@ var androidKeyToDriverKeyName = map[int]driver.Key{
|
|||||||
140: driver.KeyF10,
|
140: driver.KeyF10,
|
||||||
141: driver.KeyF11,
|
141: driver.KeyF11,
|
||||||
142: driver.KeyF12,
|
142: driver.KeyF12,
|
||||||
143: driver.KeyKeyNumLock,
|
143: driver.KeyNumLock,
|
||||||
144: driver.KeyKP0,
|
144: driver.KeyKP0,
|
||||||
145: driver.KeyKP1,
|
145: driver.KeyKP1,
|
||||||
146: driver.KeyKP2,
|
146: driver.KeyKP2,
|
||||||
@ -117,11 +117,11 @@ var androidKeyToDriverKeyName = map[int]driver.Key{
|
|||||||
151: driver.KeyKP7,
|
151: driver.KeyKP7,
|
||||||
152: driver.KeyKP8,
|
152: driver.KeyKP8,
|
||||||
153: driver.KeyKP9,
|
153: driver.KeyKP9,
|
||||||
154: driver.KeyKeyKPDivide,
|
154: driver.KeyKPDivide,
|
||||||
155: driver.KeyKeyKPMultiply,
|
155: driver.KeyKPMultiply,
|
||||||
156: driver.KeyKeyKPSubtract,
|
156: driver.KeyKPSubtract,
|
||||||
157: driver.KeyKeyKPAdd,
|
157: driver.KeyKPAdd,
|
||||||
158: driver.KeyKeyKPDecimal,
|
158: driver.KeyKPDecimal,
|
||||||
160: driver.KeyKeyKPEnter,
|
160: driver.KeyKPEnter,
|
||||||
161: driver.KeyKeyKPEqual,
|
161: driver.KeyKPEqual,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user