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