Unverified Commit b70d260b authored by Francisco Magdaleno's avatar Francisco Magdaleno Committed by GitHub

Adds the keyboard mapping for Linux (#29993)

parent a1712dcf
......@@ -97,6 +97,11 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
dataText.add(Text('characters: ${data.characters}'));
dataText.add(Text('charactersIgnoringModifiers: ${data.charactersIgnoringModifiers}'));
dataText.add(Text('modifiers: ${data.modifiers} (${_asHex(data.modifiers)})'));
} else if (data is RawKeyEventDataLinux) {
dataText.add(Text('keyCode: ${data.keyCode} (${_asHex(data.keyCode)})'));
dataText.add(Text('scanCode: ${data.scanCode}'));
dataText.add(Text('codePoint: ${data.codePoint}'));
dataText.add(Text('modifiers: ${data.modifiers} (${_asHex(data.modifiers)})'));
}
dataText.add(Text('logical: ${_event.logicalKey}'));
dataText.add(Text('physical: ${_event.physicalKey}'));
......
......@@ -38,6 +38,11 @@ Future<String> getAndroidScanCodes() async {
return utf8.decode(base64.decode(await http.read(scanCodesUri)));
}
Future<String> getGlfwKeyCodes() async {
final Uri keyCodesUri = Uri.parse('https://raw.githubusercontent.com/glfw/glfw/master/include/GLFW/glfw3.h');
return await http.read(keyCodesUri);
}
Future<void> main(List<String> rawArguments) async {
final ArgParser argParser = ArgParser();
argParser.addOption(
......@@ -66,6 +71,19 @@ Future<void> main(List<String> rawArguments) async {
defaultsTo: path.join(flutterRoot.path, 'dev', 'tools', 'gen_keycodes', 'data', 'key_name_to_android_name.json'),
help: 'The path to where the Android keycode to DomKey mapping is.',
);
argParser.addOption(
'glfw-keycodes',
defaultsTo: null,
help: 'The path to where the GLFW keycodes header file should be read. '
'If --glfw-keycodes is not specified, the input will be read from the '
'correct file in the GLFW github repository.',
);
argParser.addOption(
'glfw-domkey',
defaultsTo: path.join(flutterRoot.path, 'dev', 'tools', 'gen_keycodes', 'data', 'key_name_to_glfw_name.json'),
help: 'The path to where the GLFW keycode to DomKey mapping is.',
);
argParser.addOption(
'data',
defaultsTo: path.join(flutterRoot.path, 'dev', 'tools', 'gen_keycodes', 'data', 'key_data.json'),
......@@ -136,8 +154,17 @@ Future<void> main(List<String> rawArguments) async {
androidScanCodes = File(parsedArguments['android-scancodes']).readAsStringSync();
}
String glfwKeyCodes;
if (parsedArguments['glfw-keycodes'] == null) {
glfwKeyCodes = await getGlfwKeyCodes();
} else {
glfwKeyCodes = File(parsedArguments['glfw-keycodes']).readAsStringSync();
}
final String glfwToDomKey = File(parsedArguments['glfw-domkey']).readAsStringSync();
final String androidToDomKey = File(parsedArguments['android-domkey']).readAsStringSync();
data = KeyData(hidCodes, androidScanCodes, androidKeyCodes, androidToDomKey);
data = KeyData(hidCodes, androidScanCodes, androidKeyCodes, androidToDomKey, glfwKeyCodes, glfwToDomKey);
const JsonEncoder encoder = JsonEncoder.withIndent(' ');
File(parsedArguments['data']).writeAsStringSync(encoder.convert(data.toJson()));
......
......@@ -6,7 +6,8 @@
"UNKNOWN"
],
"english": "None",
"chromium": "none"
"chromium": "none",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -19,7 +20,8 @@
"keyCodes": {
"android": [
0
]
],
"glfw": null
}
},
"hyper": {
......@@ -27,7 +29,8 @@
"domkey": "Hyper",
"android": null,
"english": "Hyper",
"chromium": "hyper"
"chromium": "hyper",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -38,7 +41,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"superKey": {
......@@ -46,7 +50,8 @@
"domkey": "Super",
"android": null,
"english": "Super Key",
"chromium": "super"
"chromium": "super",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -57,7 +62,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"fn": {
......@@ -67,7 +73,8 @@
"FUNCTION"
],
"english": "Fn",
"chromium": "fn"
"chromium": "fn",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -82,7 +89,8 @@
"keyCodes": {
"android": [
119
]
],
"glfw": null
}
},
"fnLock": {
......@@ -90,7 +98,8 @@
"domkey": "FnLock",
"android": null,
"english": "Fn Lock",
"chromium": "fnLock"
"chromium": "fnLock",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -101,7 +110,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"suspend": {
......@@ -111,7 +121,8 @@
"SUSPEND"
],
"english": "Suspend",
"chromium": "suspend"
"chromium": "suspend",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -124,7 +135,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"resume": {
......@@ -132,7 +144,8 @@
"domkey": "Resume",
"android": null,
"english": "Resume",
"chromium": "resume"
"chromium": "resume",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -143,7 +156,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"turbo": {
......@@ -151,7 +165,8 @@
"domkey": "Turbo",
"android": null,
"english": "Turbo",
"chromium": "turbo"
"chromium": "turbo",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -162,7 +177,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"launchAssistant": {
......@@ -172,7 +188,8 @@
"ASSIST"
],
"english": "Launch Assistant",
"chromium": "launchAssistant"
"chromium": "launchAssistant",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -185,7 +202,8 @@
"keyCodes": {
"android": [
219
]
],
"glfw": null
}
},
"sleep": {
......@@ -195,7 +213,8 @@
"SLEEP"
],
"english": "Sleep",
"chromium": "sleep"
"chromium": "sleep",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -210,7 +229,8 @@
"keyCodes": {
"android": [
223
]
],
"glfw": null
}
},
"wakeUp": {
......@@ -220,7 +240,8 @@
"WAKEUP"
],
"english": "Wake Up",
"chromium": "wakeUp"
"chromium": "wakeUp",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -235,7 +256,8 @@
"keyCodes": {
"android": [
224
]
],
"glfw": null
}
},
"usbReserved": {
......@@ -243,7 +265,8 @@
"domkey": null,
"android": null,
"english": "Usb Reserved",
"chromium": "usbReserved"
"chromium": "usbReserved",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -254,7 +277,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"usbErrorRollOver": {
......@@ -262,7 +286,8 @@
"domkey": null,
"android": null,
"english": "Usb Error Roll Over",
"chromium": "usbErrorRollOver"
"chromium": "usbErrorRollOver",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -273,7 +298,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"usbPostFail": {
......@@ -281,7 +307,8 @@
"domkey": null,
"android": null,
"english": "Usb Post Fail",
"chromium": "usbPostFail"
"chromium": "usbPostFail",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -292,7 +319,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"usbErrorUndefined": {
......@@ -300,7 +328,8 @@
"domkey": null,
"android": null,
"english": "Usb Error Undefined",
"chromium": "usbErrorUndefined"
"chromium": "usbErrorUndefined",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -311,7 +340,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"keyA": {
......@@ -321,7 +351,10 @@
"A"
],
"english": "Key A",
"chromium": "usA"
"chromium": "usA",
"glfw": [
"A"
]
},
"scanCodes": {
"android": [
......@@ -336,6 +369,9 @@
"keyCodes": {
"android": [
29
],
"glfw": [
65
]
}
},
......@@ -346,7 +382,10 @@
"B"
],
"english": "Key B",
"chromium": "usB"
"chromium": "usB",
"glfw": [
"B"
]
},
"scanCodes": {
"android": [
......@@ -361,6 +400,9 @@
"keyCodes": {
"android": [
30
],
"glfw": [
66
]
}
},
......@@ -371,7 +413,10 @@
"C"
],
"english": "Key C",
"chromium": "usC"
"chromium": "usC",
"glfw": [
"C"
]
},
"scanCodes": {
"android": [
......@@ -386,6 +431,9 @@
"keyCodes": {
"android": [
31
],
"glfw": [
67
]
}
},
......@@ -396,7 +444,10 @@
"D"
],
"english": "Key D",
"chromium": "usD"
"chromium": "usD",
"glfw": [
"D"
]
},
"scanCodes": {
"android": [
......@@ -411,6 +462,9 @@
"keyCodes": {
"android": [
32
],
"glfw": [
68
]
}
},
......@@ -421,7 +475,10 @@
"E"
],
"english": "Key E",
"chromium": "usE"
"chromium": "usE",
"glfw": [
"E"
]
},
"scanCodes": {
"android": [
......@@ -436,6 +493,9 @@
"keyCodes": {
"android": [
33
],
"glfw": [
69
]
}
},
......@@ -446,7 +506,10 @@
"F"
],
"english": "Key F",
"chromium": "usF"
"chromium": "usF",
"glfw": [
"F"
]
},
"scanCodes": {
"android": [
......@@ -461,6 +524,9 @@
"keyCodes": {
"android": [
34
],
"glfw": [
70
]
}
},
......@@ -471,7 +537,10 @@
"G"
],
"english": "Key G",
"chromium": "usG"
"chromium": "usG",
"glfw": [
"G"
]
},
"scanCodes": {
"android": [
......@@ -486,6 +555,9 @@
"keyCodes": {
"android": [
35
],
"glfw": [
71
]
}
},
......@@ -496,7 +568,10 @@
"H"
],
"english": "Key H",
"chromium": "usH"
"chromium": "usH",
"glfw": [
"H"
]
},
"scanCodes": {
"android": [
......@@ -511,6 +586,9 @@
"keyCodes": {
"android": [
36
],
"glfw": [
72
]
}
},
......@@ -521,7 +599,10 @@
"I"
],
"english": "Key I",
"chromium": "usI"
"chromium": "usI",
"glfw": [
"I"
]
},
"scanCodes": {
"android": [
......@@ -536,6 +617,9 @@
"keyCodes": {
"android": [
37
],
"glfw": [
73
]
}
},
......@@ -546,7 +630,10 @@
"J"
],
"english": "Key J",
"chromium": "usJ"
"chromium": "usJ",
"glfw": [
"J"
]
},
"scanCodes": {
"android": [
......@@ -561,6 +648,9 @@
"keyCodes": {
"android": [
38
],
"glfw": [
74
]
}
},
......@@ -571,7 +661,10 @@
"K"
],
"english": "Key K",
"chromium": "usK"
"chromium": "usK",
"glfw": [
"K"
]
},
"scanCodes": {
"android": [
......@@ -586,6 +679,9 @@
"keyCodes": {
"android": [
39
],
"glfw": [
75
]
}
},
......@@ -596,7 +692,10 @@
"L"
],
"english": "Key L",
"chromium": "usL"
"chromium": "usL",
"glfw": [
"L"
]
},
"scanCodes": {
"android": [
......@@ -611,6 +710,9 @@
"keyCodes": {
"android": [
40
],
"glfw": [
76
]
}
},
......@@ -621,7 +723,10 @@
"M"
],
"english": "Key M",
"chromium": "usM"
"chromium": "usM",
"glfw": [
"M"
]
},
"scanCodes": {
"android": [
......@@ -636,6 +741,9 @@
"keyCodes": {
"android": [
41
],
"glfw": [
77
]
}
},
......@@ -646,7 +754,10 @@
"N"
],
"english": "Key N",
"chromium": "usN"
"chromium": "usN",
"glfw": [
"N"
]
},
"scanCodes": {
"android": [
......@@ -661,6 +772,9 @@
"keyCodes": {
"android": [
42
],
"glfw": [
78
]
}
},
......@@ -671,7 +785,10 @@
"O"
],
"english": "Key O",
"chromium": "usO"
"chromium": "usO",
"glfw": [
"O"
]
},
"scanCodes": {
"android": [
......@@ -686,6 +803,9 @@
"keyCodes": {
"android": [
43
],
"glfw": [
79
]
}
},
......@@ -696,7 +816,10 @@
"P"
],
"english": "Key P",
"chromium": "usP"
"chromium": "usP",
"glfw": [
"P"
]
},
"scanCodes": {
"android": [
......@@ -711,6 +834,9 @@
"keyCodes": {
"android": [
44
],
"glfw": [
80
]
}
},
......@@ -721,7 +847,10 @@
"Q"
],
"english": "Key Q",
"chromium": "usQ"
"chromium": "usQ",
"glfw": [
"Q"
]
},
"scanCodes": {
"android": [
......@@ -736,6 +865,9 @@
"keyCodes": {
"android": [
45
],
"glfw": [
81
]
}
},
......@@ -746,7 +878,10 @@
"R"
],
"english": "Key R",
"chromium": "usR"
"chromium": "usR",
"glfw": [
"R"
]
},
"scanCodes": {
"android": [
......@@ -761,6 +896,9 @@
"keyCodes": {
"android": [
46
],
"glfw": [
82
]
}
},
......@@ -771,7 +909,10 @@
"S"
],
"english": "Key S",
"chromium": "usS"
"chromium": "usS",
"glfw": [
"S"
]
},
"scanCodes": {
"android": [
......@@ -786,6 +927,9 @@
"keyCodes": {
"android": [
47
],
"glfw": [
83
]
}
},
......@@ -796,7 +940,10 @@
"T"
],
"english": "Key T",
"chromium": "usT"
"chromium": "usT",
"glfw": [
"T"
]
},
"scanCodes": {
"android": [
......@@ -811,6 +958,9 @@
"keyCodes": {
"android": [
48
],
"glfw": [
84
]
}
},
......@@ -821,7 +971,10 @@
"U"
],
"english": "Key U",
"chromium": "usU"
"chromium": "usU",
"glfw": [
"U"
]
},
"scanCodes": {
"android": [
......@@ -836,6 +989,9 @@
"keyCodes": {
"android": [
49
],
"glfw": [
85
]
}
},
......@@ -846,7 +1002,10 @@
"V"
],
"english": "Key V",
"chromium": "usV"
"chromium": "usV",
"glfw": [
"V"
]
},
"scanCodes": {
"android": [
......@@ -861,6 +1020,9 @@
"keyCodes": {
"android": [
50
],
"glfw": [
86
]
}
},
......@@ -871,7 +1033,10 @@
"W"
],
"english": "Key W",
"chromium": "usW"
"chromium": "usW",
"glfw": [
"W"
]
},
"scanCodes": {
"android": [
......@@ -886,6 +1051,9 @@
"keyCodes": {
"android": [
51
],
"glfw": [
87
]
}
},
......@@ -896,7 +1064,10 @@
"X"
],
"english": "Key X",
"chromium": "usX"
"chromium": "usX",
"glfw": [
"X"
]
},
"scanCodes": {
"android": [
......@@ -911,6 +1082,9 @@
"keyCodes": {
"android": [
52
],
"glfw": [
88
]
}
},
......@@ -921,7 +1095,10 @@
"Y"
],
"english": "Key Y",
"chromium": "usY"
"chromium": "usY",
"glfw": [
"Y"
]
},
"scanCodes": {
"android": [
......@@ -936,6 +1113,9 @@
"keyCodes": {
"android": [
53
],
"glfw": [
89
]
}
},
......@@ -946,7 +1126,10 @@
"Z"
],
"english": "Key Z",
"chromium": "usZ"
"chromium": "usZ",
"glfw": [
"Z"
]
},
"scanCodes": {
"android": [
......@@ -961,6 +1144,9 @@
"keyCodes": {
"android": [
54
],
"glfw": [
90
]
}
},
......@@ -971,7 +1157,10 @@
"1"
],
"english": "Digit 1",
"chromium": "digit1"
"chromium": "digit1",
"glfw": [
"1"
]
},
"scanCodes": {
"android": [
......@@ -986,6 +1175,9 @@
"keyCodes": {
"android": [
8
],
"glfw": [
49
]
}
},
......@@ -996,7 +1188,10 @@
"2"
],
"english": "Digit 2",
"chromium": "digit2"
"chromium": "digit2",
"glfw": [
"2"
]
},
"scanCodes": {
"android": [
......@@ -1011,6 +1206,9 @@
"keyCodes": {
"android": [
9
],
"glfw": [
50
]
}
},
......@@ -1021,7 +1219,10 @@
"3"
],
"english": "Digit 3",
"chromium": "digit3"
"chromium": "digit3",
"glfw": [
"3"
]
},
"scanCodes": {
"android": [
......@@ -1036,6 +1237,9 @@
"keyCodes": {
"android": [
10
],
"glfw": [
51
]
}
},
......@@ -1046,7 +1250,10 @@
"4"
],
"english": "Digit 4",
"chromium": "digit4"
"chromium": "digit4",
"glfw": [
"4"
]
},
"scanCodes": {
"android": [
......@@ -1061,6 +1268,9 @@
"keyCodes": {
"android": [
11
],
"glfw": [
52
]
}
},
......@@ -1071,7 +1281,10 @@
"5"
],
"english": "Digit 5",
"chromium": "digit5"
"chromium": "digit5",
"glfw": [
"5"
]
},
"scanCodes": {
"android": [
......@@ -1086,6 +1299,9 @@
"keyCodes": {
"android": [
12
],
"glfw": [
53
]
}
},
......@@ -1096,7 +1312,10 @@
"6"
],
"english": "Digit 6",
"chromium": "digit6"
"chromium": "digit6",
"glfw": [
"6"
]
},
"scanCodes": {
"android": [
......@@ -1111,6 +1330,9 @@
"keyCodes": {
"android": [
13
],
"glfw": [
54
]
}
},
......@@ -1121,7 +1343,10 @@
"7"
],
"english": "Digit 7",
"chromium": "digit7"
"chromium": "digit7",
"glfw": [
"7"
]
},
"scanCodes": {
"android": [
......@@ -1136,6 +1361,9 @@
"keyCodes": {
"android": [
14
],
"glfw": [
55
]
}
},
......@@ -1146,7 +1374,10 @@
"8"
],
"english": "Digit 8",
"chromium": "digit8"
"chromium": "digit8",
"glfw": [
"8"
]
},
"scanCodes": {
"android": [
......@@ -1161,6 +1392,9 @@
"keyCodes": {
"android": [
15
],
"glfw": [
56
]
}
},
......@@ -1171,7 +1405,10 @@
"9"
],
"english": "Digit 9",
"chromium": "digit9"
"chromium": "digit9",
"glfw": [
"9"
]
},
"scanCodes": {
"android": [
......@@ -1186,6 +1423,9 @@
"keyCodes": {
"android": [
16
],
"glfw": [
57
]
}
},
......@@ -1196,7 +1436,10 @@
"0"
],
"english": "Digit 0",
"chromium": "digit0"
"chromium": "digit0",
"glfw": [
"0"
]
},
"scanCodes": {
"android": [
......@@ -1211,6 +1454,9 @@
"keyCodes": {
"android": [
7
],
"glfw": [
48
]
}
},
......@@ -1221,7 +1467,10 @@
"ENTER"
],
"english": "Enter",
"chromium": "enter"
"chromium": "enter",
"glfw": [
"ENTER"
]
},
"scanCodes": {
"android": [
......@@ -1236,6 +1485,9 @@
"keyCodes": {
"android": [
66
],
"glfw": [
257
]
}
},
......@@ -1246,7 +1498,10 @@
"ESCAPE"
],
"english": "Escape",
"chromium": "escape"
"chromium": "escape",
"glfw": [
"ESCAPE"
]
},
"scanCodes": {
"android": [
......@@ -1261,6 +1516,9 @@
"keyCodes": {
"android": [
111
],
"glfw": [
256
]
}
},
......@@ -1271,7 +1529,10 @@
"DEL"
],
"english": "Backspace",
"chromium": "backspace"
"chromium": "backspace",
"glfw": [
"BACKSPACE"
]
},
"scanCodes": {
"android": [
......@@ -1286,6 +1547,9 @@
"keyCodes": {
"android": [
67
],
"glfw": [
259
]
}
},
......@@ -1296,7 +1560,10 @@
"TAB"
],
"english": "Tab",
"chromium": "tab"
"chromium": "tab",
"glfw": [
"TAB"
]
},
"scanCodes": {
"android": [
......@@ -1311,6 +1578,9 @@
"keyCodes": {
"android": [
61
],
"glfw": [
258
]
}
},
......@@ -1321,7 +1591,10 @@
"SPACE"
],
"english": "Space",
"chromium": "space"
"chromium": "space",
"glfw": [
"SPACE"
]
},
"scanCodes": {
"android": [
......@@ -1336,6 +1609,9 @@
"keyCodes": {
"android": [
62
],
"glfw": [
32
]
}
},
......@@ -1346,7 +1622,10 @@
"MINUS"
],
"english": "Minus",
"chromium": "minus"
"chromium": "minus",
"glfw": [
"MINUS"
]
},
"scanCodes": {
"android": [
......@@ -1361,6 +1640,9 @@
"keyCodes": {
"android": [
69
],
"glfw": [
45
]
}
},
......@@ -1371,7 +1653,10 @@
"EQUALS"
],
"english": "Equal",
"chromium": "equal"
"chromium": "equal",
"glfw": [
"EQUAL"
]
},
"scanCodes": {
"android": [
......@@ -1386,6 +1671,9 @@
"keyCodes": {
"android": [
70
],
"glfw": [
61
]
}
},
......@@ -1396,7 +1684,10 @@
"LEFT_BRACKET"
],
"english": "Bracket Left",
"chromium": "bracketLeft"
"chromium": "bracketLeft",
"glfw": [
"LEFT_BRACKET"
]
},
"scanCodes": {
"android": [
......@@ -1411,6 +1702,9 @@
"keyCodes": {
"android": [
71
],
"glfw": [
91
]
}
},
......@@ -1421,7 +1715,10 @@
"RIGHT_BRACKET"
],
"english": "Bracket Right",
"chromium": "bracketRight"
"chromium": "bracketRight",
"glfw": [
"RIGHT_BRACKET"
]
},
"scanCodes": {
"android": [
......@@ -1436,6 +1733,9 @@
"keyCodes": {
"android": [
72
],
"glfw": [
93
]
}
},
......@@ -1446,7 +1746,10 @@
"BACKSLASH"
],
"english": "Backslash",
"chromium": "backslash"
"chromium": "backslash",
"glfw": [
"BACKSLASH"
]
},
"scanCodes": {
"android": [
......@@ -1462,6 +1765,9 @@
"keyCodes": {
"android": [
73
],
"glfw": [
92
]
}
},
......@@ -1472,7 +1778,10 @@
"SEMICOLON"
],
"english": "Semicolon",
"chromium": "semicolon"
"chromium": "semicolon",
"glfw": [
"SEMICOLON"
]
},
"scanCodes": {
"android": [
......@@ -1487,6 +1796,9 @@
"keyCodes": {
"android": [
74
],
"glfw": [
59
]
}
},
......@@ -1497,7 +1809,10 @@
"APOSTROPHE"
],
"english": "Quote",
"chromium": "quote"
"chromium": "quote",
"glfw": [
"APOSTROPHE"
]
},
"scanCodes": {
"android": [
......@@ -1512,6 +1827,9 @@
"keyCodes": {
"android": [
75
],
"glfw": [
39
]
}
},
......@@ -1522,7 +1840,10 @@
"GRAVE"
],
"english": "Backquote",
"chromium": "backquote"
"chromium": "backquote",
"glfw": [
"GRAVE_ACCENT"
]
},
"scanCodes": {
"android": [
......@@ -1537,6 +1858,9 @@
"keyCodes": {
"android": [
68
],
"glfw": [
96
]
}
},
......@@ -1547,7 +1871,10 @@
"COMMA"
],
"english": "Comma",
"chromium": "comma"
"chromium": "comma",
"glfw": [
"COMMA"
]
},
"scanCodes": {
"android": [
......@@ -1562,6 +1889,9 @@
"keyCodes": {
"android": [
55
],
"glfw": [
44
]
}
},
......@@ -1572,7 +1902,10 @@
"PERIOD"
],
"english": "Period",
"chromium": "period"
"chromium": "period",
"glfw": [
"PERIOD"
]
},
"scanCodes": {
"android": [
......@@ -1587,6 +1920,9 @@
"keyCodes": {
"android": [
56
],
"glfw": [
46
]
}
},
......@@ -1597,7 +1933,10 @@
"SLASH"
],
"english": "Slash",
"chromium": "slash"
"chromium": "slash",
"glfw": [
"SLASH"
]
},
"scanCodes": {
"android": [
......@@ -1612,6 +1951,9 @@
"keyCodes": {
"android": [
76
],
"glfw": [
47
]
}
},
......@@ -1622,7 +1964,10 @@
"CAPS_LOCK"
],
"english": "Caps Lock",
"chromium": "capsLock"
"chromium": "capsLock",
"glfw": [
"CAPS_LOCK"
]
},
"scanCodes": {
"android": [
......@@ -1637,6 +1982,9 @@
"keyCodes": {
"android": [
115
],
"glfw": [
280
]
}
},
......@@ -1647,7 +1995,10 @@
"F1"
],
"english": "F1",
"chromium": "f1"
"chromium": "f1",
"glfw": [
"F1"
]
},
"scanCodes": {
"android": [
......@@ -1662,6 +2013,9 @@
"keyCodes": {
"android": [
131
],
"glfw": [
290
]
}
},
......@@ -1672,7 +2026,10 @@
"F2"
],
"english": "F2",
"chromium": "f2"
"chromium": "f2",
"glfw": [
"F2"
]
},
"scanCodes": {
"android": [
......@@ -1687,6 +2044,9 @@
"keyCodes": {
"android": [
132
],
"glfw": [
291
]
}
},
......@@ -1697,7 +2057,10 @@
"F3"
],
"english": "F3",
"chromium": "f3"
"chromium": "f3",
"glfw": [
"F3"
]
},
"scanCodes": {
"android": [
......@@ -1712,6 +2075,9 @@
"keyCodes": {
"android": [
133
],
"glfw": [
292
]
}
},
......@@ -1722,7 +2088,10 @@
"F4"
],
"english": "F4",
"chromium": "f4"
"chromium": "f4",
"glfw": [
"F4"
]
},
"scanCodes": {
"android": [
......@@ -1737,6 +2106,9 @@
"keyCodes": {
"android": [
134
],
"glfw": [
293
]
}
},
......@@ -1747,7 +2119,10 @@
"F5"
],
"english": "F5",
"chromium": "f5"
"chromium": "f5",
"glfw": [
"F5"
]
},
"scanCodes": {
"android": [
......@@ -1762,6 +2137,9 @@
"keyCodes": {
"android": [
135
],
"glfw": [
294
]
}
},
......@@ -1772,7 +2150,10 @@
"F6"
],
"english": "F6",
"chromium": "f6"
"chromium": "f6",
"glfw": [
"F6"
]
},
"scanCodes": {
"android": [
......@@ -1787,6 +2168,9 @@
"keyCodes": {
"android": [
136
],
"glfw": [
295
]
}
},
......@@ -1797,7 +2181,10 @@
"F7"
],
"english": "F7",
"chromium": "f7"
"chromium": "f7",
"glfw": [
"F7"
]
},
"scanCodes": {
"android": [
......@@ -1812,6 +2199,9 @@
"keyCodes": {
"android": [
137
],
"glfw": [
296
]
}
},
......@@ -1822,7 +2212,10 @@
"F8"
],
"english": "F8",
"chromium": "f8"
"chromium": "f8",
"glfw": [
"F8"
]
},
"scanCodes": {
"android": [
......@@ -1837,6 +2230,9 @@
"keyCodes": {
"android": [
138
],
"glfw": [
297
]
}
},
......@@ -1847,7 +2243,10 @@
"F9"
],
"english": "F9",
"chromium": "f9"
"chromium": "f9",
"glfw": [
"F9"
]
},
"scanCodes": {
"android": [
......@@ -1862,6 +2261,9 @@
"keyCodes": {
"android": [
139
],
"glfw": [
298
]
}
},
......@@ -1872,7 +2274,10 @@
"F10"
],
"english": "F10",
"chromium": "f10"
"chromium": "f10",
"glfw": [
"F10"
]
},
"scanCodes": {
"android": [
......@@ -1887,6 +2292,9 @@
"keyCodes": {
"android": [
140
],
"glfw": [
299
]
}
},
......@@ -1897,7 +2305,10 @@
"F11"
],
"english": "F11",
"chromium": "f11"
"chromium": "f11",
"glfw": [
"F11"
]
},
"scanCodes": {
"android": [
......@@ -1912,6 +2323,9 @@
"keyCodes": {
"android": [
141
],
"glfw": [
300
]
}
},
......@@ -1922,7 +2336,10 @@
"F12"
],
"english": "F12",
"chromium": "f12"
"chromium": "f12",
"glfw": [
"F12"
]
},
"scanCodes": {
"android": [
......@@ -1937,6 +2354,9 @@
"keyCodes": {
"android": [
142
],
"glfw": [
301
]
}
},
......@@ -1947,7 +2367,10 @@
"SYSRQ"
],
"english": "Print Screen",
"chromium": "printScreen"
"chromium": "printScreen",
"glfw": [
"PRINT_SCREEN"
]
},
"scanCodes": {
"android": [
......@@ -1962,6 +2385,9 @@
"keyCodes": {
"android": [
120
],
"glfw": [
283
]
}
},
......@@ -1972,7 +2398,8 @@
"SCROLL_LOCK"
],
"english": "Scroll Lock",
"chromium": "scrollLock"
"chromium": "scrollLock",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -1987,7 +2414,8 @@
"keyCodes": {
"android": [
116
]
],
"glfw": null
}
},
"pause": {
......@@ -1997,7 +2425,10 @@
"BREAK"
],
"english": "Pause",
"chromium": "pause"
"chromium": "pause",
"glfw": [
"PAUSE"
]
},
"scanCodes": {
"android": [
......@@ -2013,6 +2444,9 @@
"keyCodes": {
"android": [
121
],
"glfw": [
284
]
}
},
......@@ -2023,7 +2457,10 @@
"INSERT"
],
"english": "Insert",
"chromium": "insert"
"chromium": "insert",
"glfw": [
"INSERT"
]
},
"scanCodes": {
"android": [
......@@ -2038,6 +2475,9 @@
"keyCodes": {
"android": [
124
],
"glfw": [
260
]
}
},
......@@ -2048,7 +2488,10 @@
"MOVE_HOME"
],
"english": "Home",
"chromium": "home"
"chromium": "home",
"glfw": [
"HOME"
]
},
"scanCodes": {
"android": [
......@@ -2063,6 +2506,9 @@
"keyCodes": {
"android": [
122
],
"glfw": [
268
]
}
},
......@@ -2073,7 +2519,10 @@
"PAGE_UP"
],
"english": "Page Up",
"chromium": "pageUp"
"chromium": "pageUp",
"glfw": [
"PAGE_UP"
]
},
"scanCodes": {
"android": [
......@@ -2089,6 +2538,9 @@
"keyCodes": {
"android": [
92
],
"glfw": [
266
]
}
},
......@@ -2099,7 +2551,10 @@
"FORWARD_DEL"
],
"english": "Delete",
"chromium": "del"
"chromium": "del",
"glfw": [
"DELETE"
]
},
"scanCodes": {
"android": [
......@@ -2114,6 +2569,9 @@
"keyCodes": {
"android": [
112
],
"glfw": [
261
]
}
},
......@@ -2124,7 +2582,10 @@
"MOVE_END"
],
"english": "End",
"chromium": "end"
"chromium": "end",
"glfw": [
"END"
]
},
"scanCodes": {
"android": [
......@@ -2139,6 +2600,9 @@
"keyCodes": {
"android": [
123
],
"glfw": [
269
]
}
},
......@@ -2149,7 +2613,10 @@
"PAGE_DOWN"
],
"english": "Page Down",
"chromium": "pageDown"
"chromium": "pageDown",
"glfw": [
"PAGE_DOWN"
]
},
"scanCodes": {
"android": [
......@@ -2165,6 +2632,9 @@
"keyCodes": {
"android": [
93
],
"glfw": [
267
]
}
},
......@@ -2175,7 +2645,10 @@
"DPAD_RIGHT"
],
"english": "Arrow Right",
"chromium": "arrowRight"
"chromium": "arrowRight",
"glfw": [
"RIGHT"
]
},
"scanCodes": {
"android": [
......@@ -2190,6 +2663,9 @@
"keyCodes": {
"android": [
22
],
"glfw": [
262
]
}
},
......@@ -2200,7 +2676,10 @@
"DPAD_LEFT"
],
"english": "Arrow Left",
"chromium": "arrowLeft"
"chromium": "arrowLeft",
"glfw": [
"LEFT"
]
},
"scanCodes": {
"android": [
......@@ -2215,6 +2694,9 @@
"keyCodes": {
"android": [
21
],
"glfw": [
263
]
}
},
......@@ -2225,7 +2707,10 @@
"DPAD_DOWN"
],
"english": "Arrow Down",
"chromium": "arrowDown"
"chromium": "arrowDown",
"glfw": [
"DOWN"
]
},
"scanCodes": {
"android": [
......@@ -2240,6 +2725,9 @@
"keyCodes": {
"android": [
20
],
"glfw": [
264
]
}
},
......@@ -2250,7 +2738,10 @@
"DPAD_UP"
],
"english": "Arrow Up",
"chromium": "arrowUp"
"chromium": "arrowUp",
"glfw": [
"UP"
]
},
"scanCodes": {
"android": [
......@@ -2265,6 +2756,9 @@
"keyCodes": {
"android": [
19
],
"glfw": [
265
]
}
},
......@@ -2275,7 +2769,10 @@
"NUM_LOCK"
],
"english": "Num Lock",
"chromium": "numLock"
"chromium": "numLock",
"glfw": [
"NUM_LOCK"
]
},
"scanCodes": {
"android": [
......@@ -2290,6 +2787,9 @@
"keyCodes": {
"android": [
143
],
"glfw": [
282
]
}
},
......@@ -2300,7 +2800,10 @@
"NUMPAD_DIVIDE"
],
"english": "Numpad Divide",
"chromium": "numpadDivide"
"chromium": "numpadDivide",
"glfw": [
"KP_DIVIDE"
]
},
"scanCodes": {
"android": [
......@@ -2315,6 +2818,9 @@
"keyCodes": {
"android": [
154
],
"glfw": [
331
]
}
},
......@@ -2325,7 +2831,10 @@
"NUMPAD_MULTIPLY"
],
"english": "Numpad Multiply",
"chromium": "numpadMultiply"
"chromium": "numpadMultiply",
"glfw": [
"KP_MULTIPLY"
]
},
"scanCodes": {
"android": [
......@@ -2340,6 +2849,9 @@
"keyCodes": {
"android": [
155
],
"glfw": [
332
]
}
},
......@@ -2350,7 +2862,10 @@
"NUMPAD_SUBTRACT"
],
"english": "Numpad Subtract",
"chromium": "numpadSubtract"
"chromium": "numpadSubtract",
"glfw": [
"NUMPAD_SUBTRACT"
]
},
"scanCodes": {
"android": [
......@@ -2365,7 +2880,8 @@
"keyCodes": {
"android": [
156
]
],
"glfw": null
}
},
"numpadAdd": {
......@@ -2375,7 +2891,10 @@
"NUMPAD_ADD"
],
"english": "Numpad Add",
"chromium": "numpadAdd"
"chromium": "numpadAdd",
"glfw": [
"KP_ADD"
]
},
"scanCodes": {
"android": [
......@@ -2390,6 +2909,9 @@
"keyCodes": {
"android": [
157
],
"glfw": [
334
]
}
},
......@@ -2400,7 +2922,10 @@
"NUMPAD_ENTER"
],
"english": "Numpad Enter",
"chromium": "numpadEnter"
"chromium": "numpadEnter",
"glfw": [
"KP_ENTER"
]
},
"scanCodes": {
"android": [
......@@ -2415,6 +2940,9 @@
"keyCodes": {
"android": [
160
],
"glfw": [
335
]
}
},
......@@ -2425,7 +2953,10 @@
"NUMPAD_1"
],
"english": "Numpad 1",
"chromium": "numpad1"
"chromium": "numpad1",
"glfw": [
"KP_1"
]
},
"scanCodes": {
"android": [
......@@ -2440,6 +2971,9 @@
"keyCodes": {
"android": [
145
],
"glfw": [
321
]
}
},
......@@ -2450,7 +2984,10 @@
"NUMPAD_2"
],
"english": "Numpad 2",
"chromium": "numpad2"
"chromium": "numpad2",
"glfw": [
"KP_2"
]
},
"scanCodes": {
"android": [
......@@ -2465,6 +3002,9 @@
"keyCodes": {
"android": [
146
],
"glfw": [
322
]
}
},
......@@ -2475,7 +3015,10 @@
"NUMPAD_3"
],
"english": "Numpad 3",
"chromium": "numpad3"
"chromium": "numpad3",
"glfw": [
"KP_3"
]
},
"scanCodes": {
"android": [
......@@ -2490,6 +3033,9 @@
"keyCodes": {
"android": [
147
],
"glfw": [
323
]
}
},
......@@ -2500,7 +3046,10 @@
"NUMPAD_4"
],
"english": "Numpad 4",
"chromium": "numpad4"
"chromium": "numpad4",
"glfw": [
"KP_4"
]
},
"scanCodes": {
"android": [
......@@ -2515,6 +3064,9 @@
"keyCodes": {
"android": [
148
],
"glfw": [
324
]
}
},
......@@ -2525,7 +3077,10 @@
"NUMPAD_5"
],
"english": "Numpad 5",
"chromium": "numpad5"
"chromium": "numpad5",
"glfw": [
"KP_5"
]
},
"scanCodes": {
"android": [
......@@ -2540,6 +3095,9 @@
"keyCodes": {
"android": [
149
],
"glfw": [
325
]
}
},
......@@ -2550,7 +3108,10 @@
"NUMPAD_6"
],
"english": "Numpad 6",
"chromium": "numpad6"
"chromium": "numpad6",
"glfw": [
"KP_6"
]
},
"scanCodes": {
"android": [
......@@ -2565,6 +3126,9 @@
"keyCodes": {
"android": [
150
],
"glfw": [
326
]
}
},
......@@ -2575,7 +3139,10 @@
"NUMPAD_7"
],
"english": "Numpad 7",
"chromium": "numpad7"
"chromium": "numpad7",
"glfw": [
"KP_7"
]
},
"scanCodes": {
"android": [
......@@ -2590,6 +3157,9 @@
"keyCodes": {
"android": [
151
],
"glfw": [
327
]
}
},
......@@ -2600,7 +3170,10 @@
"NUMPAD_8"
],
"english": "Numpad 8",
"chromium": "numpad8"
"chromium": "numpad8",
"glfw": [
"KP_8"
]
},
"scanCodes": {
"android": [
......@@ -2615,6 +3188,9 @@
"keyCodes": {
"android": [
152
],
"glfw": [
328
]
}
},
......@@ -2625,7 +3201,10 @@
"NUMPAD_9"
],
"english": "Numpad 9",
"chromium": "numpad9"
"chromium": "numpad9",
"glfw": [
"KP_9"
]
},
"scanCodes": {
"android": [
......@@ -2640,6 +3219,9 @@
"keyCodes": {
"android": [
153
],
"glfw": [
329
]
}
},
......@@ -2650,7 +3232,10 @@
"NUMPAD_0"
],
"english": "Numpad 0",
"chromium": "numpad0"
"chromium": "numpad0",
"glfw": [
"KP_0"
]
},
"scanCodes": {
"android": [
......@@ -2665,6 +3250,9 @@
"keyCodes": {
"android": [
144
],
"glfw": [
320
]
}
},
......@@ -2675,7 +3263,10 @@
"NUMPAD_DOT"
],
"english": "Numpad Decimal",
"chromium": "numpadDecimal"
"chromium": "numpadDecimal",
"glfw": [
"KP_DECIMAL"
]
},
"scanCodes": {
"android": [
......@@ -2690,6 +3281,9 @@
"keyCodes": {
"android": [
158
],
"glfw": [
330
]
}
},
......@@ -2698,7 +3292,8 @@
"domkey": "IntlBackslash",
"android": null,
"english": "Intl Backslash",
"chromium": "intlBackslash"
"chromium": "intlBackslash",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -2709,7 +3304,8 @@
"macos": 10
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"contextMenu": {
......@@ -2719,7 +3315,10 @@
"MENU"
],
"english": "Context Menu",
"chromium": "contextMenu"
"chromium": "contextMenu",
"glfw": [
"MENU"
]
},
"scanCodes": {
"android": [
......@@ -2735,6 +3334,9 @@
"keyCodes": {
"android": [
82
],
"glfw": [
348
]
}
},
......@@ -2745,7 +3347,8 @@
"POWER"
],
"english": "Power",
"chromium": "power"
"chromium": "power",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -2761,7 +3364,8 @@
"keyCodes": {
"android": [
26
]
],
"glfw": null
}
},
"numpadEqual": {
......@@ -2771,7 +3375,10 @@
"NUMPAD_EQUALS"
],
"english": "Numpad Equal",
"chromium": "numpadEqual"
"chromium": "numpadEqual",
"glfw": [
"KP_EQUAL"
]
},
"scanCodes": {
"android": [
......@@ -2786,6 +3393,9 @@
"keyCodes": {
"android": [
161
],
"glfw": [
336
]
}
},
......@@ -2796,7 +3406,10 @@
"F13"
],
"english": "F13",
"chromium": "f13"
"chromium": "f13",
"glfw": [
"F13"
]
},
"scanCodes": {
"android": [
......@@ -2809,7 +3422,10 @@
"macos": 105
},
"keyCodes": {
"android": null
"android": null,
"glfw": [
302
]
}
},
"f14": {
......@@ -2819,7 +3435,10 @@
"F14"
],
"english": "F14",
"chromium": "f14"
"chromium": "f14",
"glfw": [
"F14"
]
},
"scanCodes": {
"android": [
......@@ -2832,7 +3451,10 @@
"macos": 107
},
"keyCodes": {
"android": null
"android": null,
"glfw": [
303
]
}
},
"f15": {
......@@ -2842,7 +3464,10 @@
"F15"
],
"english": "F15",
"chromium": "f15"
"chromium": "f15",
"glfw": [
"F15"
]
},
"scanCodes": {
"android": [
......@@ -2855,7 +3480,10 @@
"macos": 113
},
"keyCodes": {
"android": null
"android": null,
"glfw": [
304
]
}
},
"f16": {
......@@ -2865,7 +3493,10 @@
"F16"
],
"english": "F16",
"chromium": "f16"
"chromium": "f16",
"glfw": [
"F16"
]
},
"scanCodes": {
"android": [
......@@ -2878,7 +3509,10 @@
"macos": 106
},
"keyCodes": {
"android": null
"android": null,
"glfw": [
305
]
}
},
"f17": {
......@@ -2888,7 +3522,10 @@
"F17"
],
"english": "F17",
"chromium": "f17"
"chromium": "f17",
"glfw": [
"F17"
]
},
"scanCodes": {
"android": [
......@@ -2901,7 +3538,10 @@
"macos": 64
},
"keyCodes": {
"android": null
"android": null,
"glfw": [
306
]
}
},
"f18": {
......@@ -2911,7 +3551,10 @@
"F18"
],
"english": "F18",
"chromium": "f18"
"chromium": "f18",
"glfw": [
"F18"
]
},
"scanCodes": {
"android": [
......@@ -2924,7 +3567,10 @@
"macos": 79
},
"keyCodes": {
"android": null
"android": null,
"glfw": [
307
]
}
},
"f19": {
......@@ -2934,7 +3580,10 @@
"F19"
],
"english": "F19",
"chromium": "f19"
"chromium": "f19",
"glfw": [
"F19"
]
},
"scanCodes": {
"android": [
......@@ -2947,7 +3596,10 @@
"macos": 80
},
"keyCodes": {
"android": null
"android": null,
"glfw": [
308
]
}
},
"f20": {
......@@ -2957,7 +3609,10 @@
"F20"
],
"english": "F20",
"chromium": "f20"
"chromium": "f20",
"glfw": [
"F20"
]
},
"scanCodes": {
"android": [
......@@ -2970,7 +3625,10 @@
"macos": 90
},
"keyCodes": {
"android": null
"android": null,
"glfw": [
309
]
}
},
"f21": {
......@@ -2980,7 +3638,10 @@
"F21"
],
"english": "F21",
"chromium": "f21"
"chromium": "f21",
"glfw": [
"F21"
]
},
"scanCodes": {
"android": [
......@@ -2993,7 +3654,10 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": [
310
]
}
},
"f22": {
......@@ -3003,7 +3667,10 @@
"F22"
],
"english": "F22",
"chromium": "f22"
"chromium": "f22",
"glfw": [
"F22"
]
},
"scanCodes": {
"android": [
......@@ -3016,7 +3683,10 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": [
311
]
}
},
"f23": {
......@@ -3026,7 +3696,10 @@
"F23"
],
"english": "F23",
"chromium": "f23"
"chromium": "f23",
"glfw": [
"F23"
]
},
"scanCodes": {
"android": [
......@@ -3039,7 +3712,10 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": [
312
]
}
},
"f24": {
......@@ -3049,7 +3725,8 @@
"F24"
],
"english": "F24",
"chromium": "f24"
"chromium": "f24",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3062,7 +3739,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"open": {
......@@ -3072,7 +3750,8 @@
"OPEN"
],
"english": "Open",
"chromium": "open"
"chromium": "open",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3085,7 +3764,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"help": {
......@@ -3095,7 +3775,8 @@
"HELP"
],
"english": "Help",
"chromium": "help"
"chromium": "help",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3110,7 +3791,8 @@
"keyCodes": {
"android": [
259
]
],
"glfw": null
}
},
"select": {
......@@ -3118,7 +3800,8 @@
"domkey": "Select",
"android": null,
"english": "Select",
"chromium": "select"
"chromium": "select",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3129,7 +3812,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"again": {
......@@ -3139,7 +3823,8 @@
"AGAIN"
],
"english": "Again",
"chromium": "again"
"chromium": "again",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3152,7 +3837,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"undo": {
......@@ -3162,7 +3848,8 @@
"UNDO"
],
"english": "Undo",
"chromium": "undo"
"chromium": "undo",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3175,7 +3862,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"cut": {
......@@ -3185,7 +3873,8 @@
"CUT"
],
"english": "Cut",
"chromium": "cut"
"chromium": "cut",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3200,7 +3889,8 @@
"keyCodes": {
"android": [
277
]
],
"glfw": null
}
},
"copy": {
......@@ -3210,7 +3900,8 @@
"COPY"
],
"english": "Copy",
"chromium": "copy"
"chromium": "copy",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3225,7 +3916,8 @@
"keyCodes": {
"android": [
278
]
],
"glfw": null
}
},
"paste": {
......@@ -3235,7 +3927,8 @@
"PASTE"
],
"english": "Paste",
"chromium": "paste"
"chromium": "paste",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3250,7 +3943,8 @@
"keyCodes": {
"android": [
279
]
],
"glfw": null
}
},
"find": {
......@@ -3260,7 +3954,8 @@
"FIND"
],
"english": "Find",
"chromium": "find"
"chromium": "find",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3273,7 +3968,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"audioVolumeMute": {
......@@ -3283,7 +3979,8 @@
"VOLUME_MUTE"
],
"english": "Audio Volume Mute",
"chromium": "volumeMute"
"chromium": "volumeMute",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3298,7 +3995,8 @@
"keyCodes": {
"android": [
164
]
],
"glfw": null
}
},
"audioVolumeUp": {
......@@ -3308,7 +4006,8 @@
"VOLUME_UP"
],
"english": "Audio Volume Up",
"chromium": "volumeUp"
"chromium": "volumeUp",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3323,7 +4022,8 @@
"keyCodes": {
"android": [
24
]
],
"glfw": null
}
},
"audioVolumeDown": {
......@@ -3333,7 +4033,8 @@
"VOLUME_DOWN"
],
"english": "Audio Volume Down",
"chromium": "volumeDown"
"chromium": "volumeDown",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3348,7 +4049,8 @@
"keyCodes": {
"android": [
25
]
],
"glfw": null
}
},
"numpadComma": {
......@@ -3358,7 +4060,8 @@
"NUMPAD_COMMA"
],
"english": "Numpad Comma",
"chromium": "numpadComma"
"chromium": "numpadComma",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3374,7 +4077,8 @@
"keyCodes": {
"android": [
159
]
],
"glfw": null
}
},
"intlRo": {
......@@ -3382,7 +4086,8 @@
"domkey": "IntlRo",
"android": null,
"english": "Intl Ro",
"chromium": "intlRo"
"chromium": "intlRo",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3393,7 +4098,8 @@
"macos": 94
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"kanaMode": {
......@@ -3401,7 +4107,8 @@
"domkey": "KanaMode",
"android": null,
"english": "Kana Mode",
"chromium": "kanaMode"
"chromium": "kanaMode",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3412,7 +4119,8 @@
"macos": 104
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"intlYen": {
......@@ -3420,7 +4128,8 @@
"domkey": "IntlYen",
"android": null,
"english": "Intl Yen",
"chromium": "intlYen"
"chromium": "intlYen",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3431,7 +4140,8 @@
"macos": 93
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"convert": {
......@@ -3441,7 +4151,8 @@
"HENKAN"
],
"english": "Convert",
"chromium": "convert"
"chromium": "convert",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3456,7 +4167,8 @@
"keyCodes": {
"android": [
214
]
],
"glfw": null
}
},
"nonConvert": {
......@@ -3466,7 +4178,8 @@
"MUHENKAN"
],
"english": "Non Convert",
"chromium": "nonConvert"
"chromium": "nonConvert",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3481,7 +4194,8 @@
"keyCodes": {
"android": [
213
]
],
"glfw": null
}
},
"lang1": {
......@@ -3489,7 +4203,8 @@
"domkey": "Lang1",
"android": null,
"english": "Lang 1",
"chromium": "lang1"
"chromium": "lang1",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3500,7 +4215,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"lang2": {
......@@ -3508,7 +4224,8 @@
"domkey": "Lang2",
"android": null,
"english": "Lang 2",
"chromium": "lang2"
"chromium": "lang2",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3519,7 +4236,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"lang3": {
......@@ -3529,7 +4247,8 @@
"KATAKANA"
],
"english": "Lang 3",
"chromium": "lang3"
"chromium": "lang3",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3542,7 +4261,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"lang4": {
......@@ -3552,7 +4272,8 @@
"HIRAGANA"
],
"english": "Lang 4",
"chromium": "lang4"
"chromium": "lang4",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3565,7 +4286,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"lang5": {
......@@ -3573,7 +4295,8 @@
"domkey": "Lang5",
"android": null,
"english": "Lang 5",
"chromium": "lang5"
"chromium": "lang5",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3584,7 +4307,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"abort": {
......@@ -3592,7 +4316,8 @@
"domkey": "Abort",
"android": null,
"english": "Abort",
"chromium": "abort"
"chromium": "abort",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3603,7 +4328,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"props": {
......@@ -3613,7 +4339,8 @@
"PROPS"
],
"english": "Props",
"chromium": "props"
"chromium": "props",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3626,7 +4353,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"numpadParenLeft": {
......@@ -3636,7 +4364,8 @@
"NUMPAD_LEFT_PAREN"
],
"english": "Numpad Paren Left",
"chromium": "numpadParenLeft"
"chromium": "numpadParenLeft",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3651,7 +4380,8 @@
"keyCodes": {
"android": [
162
]
],
"glfw": null
}
},
"numpadParenRight": {
......@@ -3661,7 +4391,8 @@
"NUMPAD_RIGHT_PAREN"
],
"english": "Numpad Paren Right",
"chromium": "numpadParenRight"
"chromium": "numpadParenRight",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3676,7 +4407,8 @@
"keyCodes": {
"android": [
163
]
],
"glfw": null
}
},
"numpadBackspace": {
......@@ -3684,7 +4416,8 @@
"domkey": "NumpadBackspace",
"android": null,
"english": "Numpad Backspace",
"chromium": "numpadBackspace"
"chromium": "numpadBackspace",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3695,7 +4428,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"numpadMemoryStore": {
......@@ -3703,7 +4437,8 @@
"domkey": "NumpadMemoryStore",
"android": null,
"english": "Numpad Memory Store",
"chromium": "numpadMemoryStore"
"chromium": "numpadMemoryStore",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3714,7 +4449,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"numpadMemoryRecall": {
......@@ -3722,7 +4458,8 @@
"domkey": "NumpadMemoryRecall",
"android": null,
"english": "Numpad Memory Recall",
"chromium": "numpadMemoryRecall"
"chromium": "numpadMemoryRecall",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3733,7 +4470,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"numpadMemoryClear": {
......@@ -3741,7 +4479,8 @@
"domkey": "NumpadMemoryClear",
"android": null,
"english": "Numpad Memory Clear",
"chromium": "numpadMemoryClear"
"chromium": "numpadMemoryClear",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3752,7 +4491,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"numpadMemoryAdd": {
......@@ -3760,7 +4500,8 @@
"domkey": "NumpadMemoryAdd",
"android": null,
"english": "Numpad Memory Add",
"chromium": "numpadMemoryAdd"
"chromium": "numpadMemoryAdd",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3771,7 +4512,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"numpadMemorySubtract": {
......@@ -3779,7 +4521,8 @@
"domkey": "NumpadMemorySubtract",
"android": null,
"english": "Numpad Memory Subtract",
"chromium": "numpadMemorySubtract"
"chromium": "numpadMemorySubtract",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3790,7 +4533,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"numpadSignChange": {
......@@ -3798,7 +4542,8 @@
"domkey": null,
"android": null,
"english": "Numpad Sign Change",
"chromium": "numpadSignChange"
"chromium": "numpadSignChange",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3809,7 +4554,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"numpadClear": {
......@@ -3817,7 +4563,8 @@
"domkey": "NumpadClear",
"android": null,
"english": "Numpad Clear",
"chromium": "numpadClear"
"chromium": "numpadClear",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3828,7 +4575,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"numpadClearEntry": {
......@@ -3836,7 +4584,8 @@
"domkey": "NumpadClearEntry",
"android": null,
"english": "Numpad Clear Entry",
"chromium": "numpadClearEntry"
"chromium": "numpadClearEntry",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -3847,7 +4596,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"controlLeft": {
......@@ -3857,7 +4607,10 @@
"CTRL_LEFT"
],
"english": "Control Left",
"chromium": "controlLeft"
"chromium": "controlLeft",
"glfw": [
"LEFT_CONTROL"
]
},
"scanCodes": {
"android": [
......@@ -3872,6 +4625,9 @@
"keyCodes": {
"android": [
113
],
"glfw": [
341
]
}
},
......@@ -3882,7 +4638,10 @@
"SHIFT_LEFT"
],
"english": "Shift Left",
"chromium": "shiftLeft"
"chromium": "shiftLeft",
"glfw": [
"LEFT_SHIFT"
]
},
"scanCodes": {
"android": [
......@@ -3897,6 +4656,9 @@
"keyCodes": {
"android": [
59
],
"glfw": [
340
]
}
},
......@@ -3907,7 +4669,10 @@
"ALT_LEFT"
],
"english": "Alt Left",
"chromium": "altLeft"
"chromium": "altLeft",
"glfw": [
"LEFT_ALT"
]
},
"scanCodes": {
"android": [
......@@ -3922,6 +4687,9 @@
"keyCodes": {
"android": [
57
],
"glfw": [
342
]
}
},
......@@ -3932,7 +4700,8 @@
"META_LEFT"
],
"english": "Meta Left",
"chromium": "metaLeft"
"chromium": "metaLeft",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -3947,7 +4716,8 @@
"keyCodes": {
"android": [
117
]
],
"glfw": null
}
},
"controlRight": {
......@@ -3957,7 +4727,10 @@
"CTRL_RIGHT"
],
"english": "Control Right",
"chromium": "controlRight"
"chromium": "controlRight",
"glfw": [
"RIGHT_CONTROL"
]
},
"scanCodes": {
"android": [
......@@ -3972,6 +4745,9 @@
"keyCodes": {
"android": [
114
],
"glfw": [
345
]
}
},
......@@ -3982,7 +4758,10 @@
"SHIFT_RIGHT"
],
"english": "Shift Right",
"chromium": "shiftRight"
"chromium": "shiftRight",
"glfw": [
"RIGHT_SHIFT"
]
},
"scanCodes": {
"android": [
......@@ -3997,6 +4776,9 @@
"keyCodes": {
"android": [
60
],
"glfw": [
344
]
}
},
......@@ -4007,7 +4789,10 @@
"ALT_RIGHT"
],
"english": "Alt Right",
"chromium": "altRight"
"chromium": "altRight",
"glfw": [
"RIGHT_ALT"
]
},
"scanCodes": {
"android": [
......@@ -4022,6 +4807,9 @@
"keyCodes": {
"android": [
58
],
"glfw": [
346
]
}
},
......@@ -4032,7 +4820,8 @@
"META_RIGHT"
],
"english": "Meta Right",
"chromium": "metaRight"
"chromium": "metaRight",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4047,7 +4836,8 @@
"keyCodes": {
"android": [
118
]
],
"glfw": null
}
},
"info": {
......@@ -4057,7 +4847,8 @@
"INFO"
],
"english": "Info",
"chromium": "info"
"chromium": "info",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4072,7 +4863,8 @@
"keyCodes": {
"android": [
165
]
],
"glfw": null
}
},
"closedCaptionToggle": {
......@@ -4082,7 +4874,8 @@
"CAPTIONS"
],
"english": "Closed Caption Toggle",
"chromium": "closedCaptionToggle"
"chromium": "closedCaptionToggle",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4095,7 +4888,8 @@
"keyCodes": {
"android": [
175
]
],
"glfw": null
}
},
"brightnessUp": {
......@@ -4105,7 +4899,8 @@
"BRIGHTNESS_UP"
],
"english": "Brightness Up",
"chromium": "brightnessUp"
"chromium": "brightnessUp",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4120,7 +4915,8 @@
"keyCodes": {
"android": [
221
]
],
"glfw": null
}
},
"brightnessDown": {
......@@ -4130,7 +4926,8 @@
"BRIGHTNESS_DOWN"
],
"english": "Brightness Down",
"chromium": "brightnessDown"
"chromium": "brightnessDown",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4145,7 +4942,8 @@
"keyCodes": {
"android": [
220
]
],
"glfw": null
}
},
"brightnessToggle": {
......@@ -4153,7 +4951,8 @@
"domkey": null,
"android": null,
"english": "Brightness Toggle",
"chromium": "brightnessToggle"
"chromium": "brightnessToggle",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4164,7 +4963,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"brightnessMinimum": {
......@@ -4172,7 +4972,8 @@
"domkey": null,
"android": null,
"english": "Brightness Minimum",
"chromium": "brightnessMinimum"
"chromium": "brightnessMinimum",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4183,7 +4984,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"brightnessMaximum": {
......@@ -4191,7 +4993,8 @@
"domkey": null,
"android": null,
"english": "Brightness Maximum",
"chromium": "brightnessMaximum"
"chromium": "brightnessMaximum",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4202,7 +5005,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"brightnessAuto": {
......@@ -4210,7 +5014,8 @@
"domkey": null,
"android": null,
"english": "Brightness Auto",
"chromium": "brightnessAuto"
"chromium": "brightnessAuto",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4221,7 +5026,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"mediaLast": {
......@@ -4231,7 +5037,8 @@
"LAST_CHANNEL"
],
"english": "Media Last",
"chromium": "mediaLast"
"chromium": "mediaLast",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4244,7 +5051,8 @@
"keyCodes": {
"android": [
229
]
],
"glfw": null
}
},
"launchPhone": {
......@@ -4252,7 +5060,8 @@
"domkey": null,
"android": null,
"english": "Launch Phone",
"chromium": "launchPhone"
"chromium": "launchPhone",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4263,7 +5072,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"programGuide": {
......@@ -4271,7 +5081,8 @@
"domkey": null,
"android": null,
"english": "Program Guide",
"chromium": "programGuide"
"chromium": "programGuide",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4282,7 +5093,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"exit": {
......@@ -4292,7 +5104,8 @@
"EXIT"
],
"english": "Exit",
"chromium": "exit"
"chromium": "exit",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4305,7 +5118,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"channelUp": {
......@@ -4315,7 +5129,8 @@
"CHANNEL_UP"
],
"english": "Channel Up",
"chromium": "channelUp"
"chromium": "channelUp",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4330,7 +5145,8 @@
"keyCodes": {
"android": [
166
]
],
"glfw": null
}
},
"channelDown": {
......@@ -4340,7 +5156,8 @@
"CHANNEL_DOWN"
],
"english": "Channel Down",
"chromium": "channelDown"
"chromium": "channelDown",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4355,7 +5172,8 @@
"keyCodes": {
"android": [
167
]
],
"glfw": null
}
},
"mediaPlay": {
......@@ -4365,7 +5183,8 @@
"MEDIA_PLAY"
],
"english": "Media Play",
"chromium": "mediaPlay"
"chromium": "mediaPlay",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4381,7 +5200,8 @@
"keyCodes": {
"android": [
126
]
],
"glfw": null
}
},
"mediaRecord": {
......@@ -4391,7 +5211,8 @@
"MEDIA_RECORD"
],
"english": "Media Record",
"chromium": "mediaRecord"
"chromium": "mediaRecord",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4406,7 +5227,8 @@
"keyCodes": {
"android": [
130
]
],
"glfw": null
}
},
"mediaFastForward": {
......@@ -4416,7 +5238,8 @@
"MEDIA_FAST_FORWARD"
],
"english": "Media Fast Forward",
"chromium": "mediaFastForward"
"chromium": "mediaFastForward",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4431,7 +5254,8 @@
"keyCodes": {
"android": [
90
]
],
"glfw": null
}
},
"mediaRewind": {
......@@ -4441,7 +5265,8 @@
"MEDIA_REWIND"
],
"english": "Media Rewind",
"chromium": "mediaRewind"
"chromium": "mediaRewind",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4456,7 +5281,8 @@
"keyCodes": {
"android": [
89
]
],
"glfw": null
}
},
"mediaTrackNext": {
......@@ -4466,7 +5292,8 @@
"MEDIA_NEXT"
],
"english": "Media Track Next",
"chromium": "mediaTrackNext"
"chromium": "mediaTrackNext",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4481,7 +5308,8 @@
"keyCodes": {
"android": [
87
]
],
"glfw": null
}
},
"mediaTrackPrevious": {
......@@ -4491,7 +5319,8 @@
"MEDIA_PREVIOUS"
],
"english": "Media Track Previous",
"chromium": "mediaTrackPrevious"
"chromium": "mediaTrackPrevious",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4506,7 +5335,8 @@
"keyCodes": {
"android": [
88
]
],
"glfw": null
}
},
"mediaStop": {
......@@ -4516,7 +5346,8 @@
"MEDIA_STOP"
],
"english": "Media Stop",
"chromium": "mediaStop"
"chromium": "mediaStop",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4532,7 +5363,8 @@
"keyCodes": {
"android": [
86
]
],
"glfw": null
}
},
"eject": {
......@@ -4542,7 +5374,8 @@
"MEDIA_EJECT"
],
"english": "Eject",
"chromium": "eject"
"chromium": "eject",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4558,7 +5391,8 @@
"keyCodes": {
"android": [
129
]
],
"glfw": null
}
},
"mediaPlayPause": {
......@@ -4568,7 +5402,8 @@
"MEDIA_PLAY_PAUSE"
],
"english": "Media Play Pause",
"chromium": "mediaPlayPause"
"chromium": "mediaPlayPause",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4583,7 +5418,8 @@
"keyCodes": {
"android": [
85
]
],
"glfw": null
}
},
"speechInputToggle": {
......@@ -4591,7 +5427,8 @@
"domkey": null,
"android": null,
"english": "Speech Input Toggle",
"chromium": "speechInputToggle"
"chromium": "speechInputToggle",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4602,7 +5439,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"bassBoost": {
......@@ -4612,7 +5450,8 @@
"BASSBOOST"
],
"english": "Bass Boost",
"chromium": "bassBoost"
"chromium": "bassBoost",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4625,7 +5464,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"mediaSelect": {
......@@ -4633,7 +5473,8 @@
"domkey": "MediaSelect",
"android": null,
"english": "Media Select",
"chromium": "mediaSelect"
"chromium": "mediaSelect",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4644,7 +5485,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"launchWordProcessor": {
......@@ -4652,7 +5494,8 @@
"domkey": null,
"android": null,
"english": "Launch Word Processor",
"chromium": "launchWordProcessor"
"chromium": "launchWordProcessor",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4663,7 +5506,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"launchSpreadsheet": {
......@@ -4671,7 +5515,8 @@
"domkey": null,
"android": null,
"english": "Launch Spreadsheet",
"chromium": "launchSpreadsheet"
"chromium": "launchSpreadsheet",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4682,7 +5527,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"launchMail": {
......@@ -4692,7 +5538,8 @@
"ENVELOPE"
],
"english": "Launch Mail",
"chromium": "launchMail"
"chromium": "launchMail",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4708,7 +5555,8 @@
"keyCodes": {
"android": [
65
]
],
"glfw": null
}
},
"launchContacts": {
......@@ -4718,7 +5566,8 @@
"CONTACTS"
],
"english": "Launch Contacts",
"chromium": "launchContacts"
"chromium": "launchContacts",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4733,7 +5582,8 @@
"keyCodes": {
"android": [
207
]
],
"glfw": null
}
},
"launchCalendar": {
......@@ -4743,7 +5593,8 @@
"CALENDAR"
],
"english": "Launch Calendar",
"chromium": "launchCalendar"
"chromium": "launchCalendar",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -4758,7 +5609,8 @@
"keyCodes": {
"android": [
208
]
],
"glfw": null
}
},
"launchApp2": {
......@@ -4766,7 +5618,8 @@
"domkey": "LaunchApp2",
"android": null,
"english": "Launch App2",
"chromium": "launchApp2"
"chromium": "launchApp2",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4777,7 +5630,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"launchApp1": {
......@@ -4785,7 +5639,8 @@
"domkey": "LaunchApp1",
"android": null,
"english": "Launch App1",
"chromium": "launchApp1"
"chromium": "launchApp1",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4796,7 +5651,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"launchInternetBrowser": {
......@@ -4804,7 +5660,8 @@
"domkey": null,
"android": null,
"english": "Launch Internet Browser",
"chromium": "launchInternetBrowser"
"chromium": "launchInternetBrowser",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4815,7 +5672,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"logOff": {
......@@ -4823,7 +5681,8 @@
"domkey": null,
"android": null,
"english": "Log Off",
"chromium": "logOff"
"chromium": "logOff",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4834,7 +5693,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"lockScreen": {
......@@ -4842,7 +5702,8 @@
"domkey": null,
"android": null,
"english": "Lock Screen",
"chromium": "lockScreen"
"chromium": "lockScreen",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4853,7 +5714,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"launchControlPanel": {
......@@ -4861,7 +5723,8 @@
"domkey": "LaunchControlPanel",
"android": null,
"english": "Launch Control Panel",
"chromium": "launchControlPanel"
"chromium": "launchControlPanel",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4872,7 +5735,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"selectTask": {
......@@ -4880,7 +5744,8 @@
"domkey": "SelectTask",
"android": null,
"english": "Select Task",
"chromium": "selectTask"
"chromium": "selectTask",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4891,7 +5756,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"launchDocuments": {
......@@ -4899,7 +5765,8 @@
"domkey": null,
"android": null,
"english": "Launch Documents",
"chromium": "launchDocuments"
"chromium": "launchDocuments",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4910,7 +5777,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"spellCheck": {
......@@ -4918,7 +5786,8 @@
"domkey": null,
"android": null,
"english": "Spell Check",
"chromium": "spellCheck"
"chromium": "spellCheck",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4929,7 +5798,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"launchKeyboardLayout": {
......@@ -4937,7 +5807,8 @@
"domkey": null,
"android": null,
"english": "Launch Keyboard Layout",
"chromium": "launchKeyboardLayout"
"chromium": "launchKeyboardLayout",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4948,7 +5819,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"launchScreenSaver": {
......@@ -4956,7 +5828,8 @@
"domkey": "LaunchScreenSaver",
"android": null,
"english": "Launch Screen Saver",
"chromium": "launchScreenSaver"
"chromium": "launchScreenSaver",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4967,7 +5840,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"launchAudioBrowser": {
......@@ -4975,7 +5849,8 @@
"domkey": null,
"android": null,
"english": "Launch Audio Browser",
"chromium": "launchAudioBrowser"
"chromium": "launchAudioBrowser",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -4986,7 +5861,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"newKey": {
......@@ -4996,7 +5872,8 @@
"NEW"
],
"english": "New Key",
"chromium": "new"
"chromium": "new",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -5009,7 +5886,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"close": {
......@@ -5020,7 +5898,8 @@
"CLOSE"
],
"english": "Close",
"chromium": "close"
"chromium": "close",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -5036,7 +5915,8 @@
"keyCodes": {
"android": [
128
]
],
"glfw": null
}
},
"save": {
......@@ -5044,7 +5924,8 @@
"domkey": null,
"android": null,
"english": "Save",
"chromium": "save"
"chromium": "save",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -5055,7 +5936,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"print": {
......@@ -5065,7 +5947,8 @@
"PRINT"
],
"english": "Print",
"chromium": "print"
"chromium": "print",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -5078,7 +5961,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"browserSearch": {
......@@ -5088,7 +5972,8 @@
"SEARCH"
],
"english": "Browser Search",
"chromium": "browserSearch"
"chromium": "browserSearch",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -5103,7 +5988,8 @@
"keyCodes": {
"android": [
84
]
],
"glfw": null
}
},
"browserHome": {
......@@ -5111,7 +5997,8 @@
"domkey": "BrowserHome",
"android": null,
"english": "Browser Home",
"chromium": "browserHome"
"chromium": "browserHome",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -5122,7 +6009,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"browserBack": {
......@@ -5130,7 +6018,8 @@
"domkey": "BrowserBack",
"android": null,
"english": "Browser Back",
"chromium": "browserBack"
"chromium": "browserBack",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -5141,7 +6030,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"browserForward": {
......@@ -5151,7 +6041,8 @@
"FORWARD"
],
"english": "Browser Forward",
"chromium": "browserForward"
"chromium": "browserForward",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -5166,7 +6057,8 @@
"keyCodes": {
"android": [
125
]
],
"glfw": null
}
},
"browserStop": {
......@@ -5174,7 +6066,8 @@
"domkey": "BrowserStop",
"android": null,
"english": "Browser Stop",
"chromium": "browserStop"
"chromium": "browserStop",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -5185,7 +6078,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"browserRefresh": {
......@@ -5193,7 +6087,8 @@
"domkey": "BrowserRefresh",
"android": null,
"english": "Browser Refresh",
"chromium": "browserRefresh"
"chromium": "browserRefresh",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -5204,7 +6099,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"browserFavorites": {
......@@ -5214,7 +6110,8 @@
"BOOKMARK"
],
"english": "Browser Favorites",
"chromium": "browserFavorites"
"chromium": "browserFavorites",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -5229,7 +6126,8 @@
"keyCodes": {
"android": [
174
]
],
"glfw": null
}
},
"zoomIn": {
......@@ -5239,7 +6137,8 @@
"ZOOM_IN"
],
"english": "Zoom In",
"chromium": "zoomIn"
"chromium": "zoomIn",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -5252,7 +6151,8 @@
"keyCodes": {
"android": [
168
]
],
"glfw": null
}
},
"zoomOut": {
......@@ -5262,7 +6162,8 @@
"ZOOM_OUT"
],
"english": "Zoom Out",
"chromium": "zoomOut"
"chromium": "zoomOut",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -5275,7 +6176,8 @@
"keyCodes": {
"android": [
169
]
],
"glfw": null
}
},
"zoomToggle": {
......@@ -5285,7 +6187,8 @@
"TV_ZOOM_MODE"
],
"english": "Zoom Toggle",
"chromium": "zoomToggle"
"chromium": "zoomToggle",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -5298,7 +6201,8 @@
"keyCodes": {
"android": [
255
]
],
"glfw": null
}
},
"redo": {
......@@ -5308,7 +6212,8 @@
"REDO"
],
"english": "Redo",
"chromium": "redo"
"chromium": "redo",
"glfw": null
},
"scanCodes": {
"android": [
......@@ -5321,7 +6226,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"mailReply": {
......@@ -5329,7 +6235,8 @@
"domkey": "MailReply",
"android": null,
"english": "Mail Reply",
"chromium": "mailReply"
"chromium": "mailReply",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -5340,7 +6247,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"mailForward": {
......@@ -5348,7 +6256,8 @@
"domkey": "MailForward",
"android": null,
"english": "Mail Forward",
"chromium": "mailForward"
"chromium": "mailForward",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -5359,7 +6268,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
},
"mailSend": {
......@@ -5367,7 +6277,8 @@
"domkey": "MailSend",
"android": null,
"english": "Mail Send",
"chromium": "mailSend"
"chromium": "mailSend",
"glfw": null
},
"scanCodes": {
"android": null,
......@@ -5378,7 +6289,8 @@
"macos": null
},
"keyCodes": {
"android": null
"android": null,
"glfw": null
}
}
}
\ No newline at end of file
{
"altLeft": ["LEFT_ALT"],
"altRight": ["RIGHT_ALT"],
"arrowDown": ["DOWN"],
"arrowLeft": ["LEFT"],
"arrowRight": ["RIGHT"],
"arrowUp": ["UP"],
"backquote": ["GRAVE_ACCENT"],
"backslash": ["BACKSLASH"],
"backspace": ["BACKSPACE"],
"bracketLeft": ["LEFT_BRACKET"],
"bracketRight": ["RIGHT_BRACKET"],
"capsLock": ["CAPS_LOCK"],
"controlLeft": ["LEFT_CONTROL"],
"controlRight": ["RIGHT_CONTROL"],
"contextMenu": ["MENU"],
"comma": ["COMMA"],
"delete": ["DELETE"],
"digit0": ["0"],
"digit1": ["1"],
"digit2": ["2"],
"digit3": ["3"],
"digit4": ["4"],
"digit5": ["5"],
"digit6": ["6"],
"digit7": ["7"],
"digit8": ["8"],
"digit9": ["9"],
"end": ["END"],
"enter": ["ENTER"],
"equal": ["EQUAL"],
"escape": ["ESCAPE"],
"f1": ["F1"],
"f2": ["F2"],
"f3": ["F3"],
"f4": ["F4"],
"f5": ["F5"],
"f6": ["F6"],
"f7": ["F7"],
"f8": ["F8"],
"f9": ["F9"],
"f10": ["F10"],
"f11": ["F11"],
"f12": ["F12"],
"f13": ["F13"],
"f14": ["F14"],
"f15": ["F15"],
"f16": ["F16"],
"f17": ["F17"],
"f18": ["F18"],
"f19": ["F19"],
"f20": ["F20"],
"f21": ["F21"],
"f22": ["F22"],
"f23": ["F23"],
"f25": ["F25"],
"home": ["HOME"],
"insert": ["INSERT"],
"keyA": ["A"],
"keyB": ["B"],
"keyC": ["C"],
"keyD": ["D"],
"keyE": ["E"],
"keyF": ["F"],
"keyG": ["G"],
"keyH": ["H"],
"keyI": ["I"],
"keyJ": ["J"],
"keyK": ["K"],
"keyL": ["L"],
"keyM": ["M"],
"keyN": ["N"],
"keyO": ["O"],
"keyP": ["P"],
"keyQ": ["Q"],
"keyR": ["R"],
"keyS": ["S"],
"keyT": ["T"],
"keyU": ["U"],
"keyV": ["V"],
"keyW": ["W"],
"keyX": ["X"],
"keyY": ["Y"],
"keyZ": ["Z"],
"minus": ["MINUS"],
"numLock": ["NUM_LOCK"],
"numpad0": ["KP_0"],
"numpad1": ["KP_1"],
"numpad2": ["KP_2"],
"numpad3": ["KP_3"],
"numpad4": ["KP_4"],
"numpad5": ["KP_5"],
"numpad6": ["KP_6"],
"numpad7": ["KP_7"],
"numpad8": ["KP_8"],
"numpad9": ["KP_9"],
"numpadDecimal": ["KP_DECIMAL"],
"numpadDivide": ["KP_DIVIDE"],
"numpadMultiply": ["KP_MULTIPLY"],
"numpadSubtract": ["NUMPAD_SUBTRACT"],
"numpadAdd": ["KP_ADD"],
"numpadEnter": ["KP_ENTER"],
"numpadEqual": ["KP_EQUAL"],
"pageDown": ["PAGE_DOWN"],
"pageUp": ["PAGE_UP"],
"pause": ["PAUSE"],
"printScreen": ["PRINT_SCREEN"],
"quote": ["APOSTROPHE"],
"period": ["PERIOD"],
"semicolon": ["SEMICOLON"],
"slash": ["SLASH"],
"space": ["SPACE"],
"shiftLeft": ["LEFT_SHIFT"],
"shiftRight": ["RIGHT_SHIFT"],
"tab": ["TAB"]
}
......@@ -50,3 +50,21 @@ const Map<int, PhysicalKeyboardKey> kMacOsToPhysicalKey = <int, PhysicalKeyboard
const Map<int, LogicalKeyboardKey> kMacOsNumPadMap = <int, LogicalKeyboardKey>{
@@@MACOS_NUMPAD_MAP@@@
};
/// Maps GLFW-specific key codes to the matching [LogicalKeyboardKey].
const Map<int, LogicalKeyboardKey> kGlfwToLogicalKey = <int, LogicalKeyboardKey>{
@@@GLFW_KEY_CODE_MAP@@@
};
/// A map of GLFW key codes which have printable representations, but appear
/// on the number pad. Used to provide different key objects for keys like
/// KEY_EQUALS and NUMPAD_EQUALS.
const Map<int, LogicalKeyboardKey> kGlfwNumpadMap = <int, LogicalKeyboardKey>{
@@@GLFW_NUMPAD_MAP@@@
};
/// Maps XKB specific key code values representing [PhysicalKeyboardKey].
const Map<int, PhysicalKeyboardKey> kLinuxToPhysicalKey = <int, PhysicalKeyboardKey>{
@@@XKB_SCAN_CODE_MAP@@@
};
......@@ -93,6 +93,46 @@ $otherComments static const LogicalKeyboardKey ${entry.constantName} = LogicalK
return keyCodeMap.toString().trimRight();
}
/// This generates the map of GLFW number pad key codes to logical keys.
String get glfwNumpadMap {
final StringBuffer glfwNumpadMap = StringBuffer();
final List<Key> onlyNumpads = keyData.data.where((Key entry) {
return entry.constantName.startsWith('numpad') && entry.keyLabel != null;
}).toList();
for (Key entry in onlyNumpads) {
if (entry.glfwKeyCodes != null) {
for (int code in entry.glfwKeyCodes.cast<int>()) {
glfwNumpadMap.writeln(' $code: LogicalKeyboardKey.${entry.constantName},');
}
}
}
return glfwNumpadMap.toString().trimRight();
}
/// This generates the map of GLFW key codes to logical keys.
String get glfwKeyCodeMap {
final StringBuffer glfwKeyCodeMap = StringBuffer();
for (Key entry in keyData.data) {
if (entry.glfwKeyCodes != null) {
for (int code in entry.glfwKeyCodes.cast<int>()) {
glfwKeyCodeMap.writeln(' $code: LogicalKeyboardKey.${entry.constantName},');
}
}
}
return glfwKeyCodeMap.toString().trimRight();
}
/// This generates the map of XKB USB HID codes to physical keys.
String get xkbScanCodeMap {
final StringBuffer xkbScanCodeMap = StringBuffer();
for (Key entry in keyData.data) {
if (entry.xKbScanCode != null) {
xkbScanCodeMap.writeln(' ${toHex(entry.xKbScanCode)}: PhysicalKeyboardKey.${entry.constantName},');
}
}
return xkbScanCodeMap.toString().trimRight();
}
/// This generates the map of Android key codes to logical keys.
String get androidKeyCodeMap {
final StringBuffer androidKeyCodeMap = StringBuffer();
......@@ -210,6 +250,9 @@ $otherComments static const LogicalKeyboardKey ${entry.constantName} = LogicalK
'FUCHSIA_KEY_CODE_MAP': fuchsiaKeyCodeMap,
'MACOS_SCAN_CODE_MAP': macOsScanCodeMap,
'MACOS_NUMPAD_MAP': macOsNumpadMap,
'GLFW_KEY_CODE_MAP': glfwKeyCodeMap,
'GLFW_NUMPAD_MAP': glfwNumpadMap,
'XKB_SCAN_CODE_MAP': xkbScanCodeMap,
};
final String template = File(path.join(flutterRoot.path, 'dev', 'tools', 'gen_keycodes', 'data', 'keyboard_maps.tmpl')).readAsStringSync();
......
......@@ -26,14 +26,25 @@ class KeyData {
String androidKeyboardLayout,
String androidKeyCodeHeader,
String androidNameMap,
String glfwKeyCodeHeader,
String glfwNameMap
) : assert(chromiumHidCodes != null),
assert(androidKeyboardLayout != null),
assert(androidKeyCodeHeader != null),
assert(androidNameMap != null) {
assert(androidNameMap != null),
assert(glfwKeyCodeHeader != null),
assert(glfwNameMap != null) {
_nameToAndroidScanCodes = _readAndroidScanCodes(androidKeyboardLayout);
_nameToAndroidKeyCode = _readAndroidKeyCodes(androidKeyCodeHeader);
final Map<String, List<dynamic>> dynamicNames = json.decode(androidNameMap).cast<String, List<dynamic>>();
_nameToAndroidName = dynamicNames.map<String, List<String>>((String key, List<dynamic> value) {
_nameToGlfwKeyCode = _readGlfwKeyCodes(glfwKeyCodeHeader);
// Cast Android dom map
final Map<String, List<dynamic>> dynamicAndroidNames = json.decode(androidNameMap).cast<String, List<dynamic>>();
_nameToAndroidName = dynamicAndroidNames.map<String, List<String>>((String key, List<dynamic> value) {
return MapEntry<String, List<String>>(key, value.cast<String>());
});
// Cast GLFW dom map
final Map<String, List<dynamic>> dynamicGlfwNames = json.decode(glfwNameMap).cast<String, List<dynamic>>();
_nameToGlfwName = dynamicGlfwNames.map<String, List<String>>((String key, List<dynamic> value) {
return MapEntry<String, List<String>>(key, value.cast<String>());
});
data = _readHidEntries(chromiumHidCodes);
......@@ -51,6 +62,7 @@ class KeyData {
/// [KeyData.fromJson].
Map<String, dynamic> toJson() {
for (Key entry in data) {
// Android Key names
entry.androidKeyNames = _nameToAndroidName[entry.constantName]?.cast<String>();
if (entry.androidKeyNames != null && entry.androidKeyNames.isNotEmpty) {
for (String androidKeyName in entry.androidKeyNames) {
......@@ -64,6 +76,17 @@ class KeyData {
}
}
}
// GLFW key names
entry.glfwKeyNames = _nameToGlfwName[entry.constantName]?.cast<String>();
if (entry.glfwKeyNames != null && entry.glfwKeyNames.isNotEmpty) {
for (String glfwKeyName in entry.glfwKeyNames) {
if (_nameToGlfwKeyCode[glfwKeyName] != null) {
entry.glfwKeyCodes ??= <int>[];
entry.glfwKeyCodes.add(_nameToGlfwKeyCode[glfwKeyName]);
}
}
}
}
final Map<String, dynamic> outputMap = <String, dynamic>{};
......@@ -83,6 +106,13 @@ class KeyData {
/// JSON.
Map<String, List<String>> _nameToAndroidName;
/// The mapping from the Flutter name (e.g. "eject") to the GLFW name (e.g.
/// "GLFW_MEDIA_EJECT").
///
/// Only populated if data is parsed from the source files, not if parsed from
/// JSON.
Map<String, List<String>> _nameToGlfwName;
/// The mapping from the Android name (e.g. "MEDIA_EJECT") to the integer scan
/// code (physical location) of the key.
///
......@@ -97,6 +127,13 @@ class KeyData {
/// JSON.
Map<String, int> _nameToAndroidKeyCode;
/// The mapping from GLFW name (e.g. "GLFW_KEY_COMMA") to the integer key code
/// (logical meaning) of the key.
///
/// Only populated if data is parsed from the source files, not if parsed from
/// JSON.
Map<String, int> _nameToGlfwKeyCode;
/// Parses entries from Androids Generic.kl scan code data file.
///
/// Lines in this file look like this (without the ///):
......@@ -147,6 +184,30 @@ class KeyData {
return result;
}
/// Parses entries from GLFW's keycodes.h key code data file.
///
/// Lines in this file look like this (without the ///):
/// /** Space key. */
/// #define GLFW_KEY_SPACE 32,
Map<String, int> _readGlfwKeyCodes(String headerFile) {
// Only get the KEY definitions, ignore the rest (mouse, joystick, etc).
final RegExp enumEntry = RegExp(r'''define GLFW_KEY_([A-Z0-9_]+)\s*([A-Z0-9_]+),?''');
final Map<String, dynamic> replaced = <String, dynamic>{};
headerFile.replaceAllMapped(enumEntry, (Match match) {
replaced[match.group(1)] = int.tryParse(match.group(2)) ?? match.group(2).replaceAll('GLFW_KEY_', '');
});
final Map<String, int> result = <String, int>{};
replaced.forEach((String key, dynamic value) {
// Some definition values point to other definitions (e.g #define GLFW_KEY_LAST GLFW_KEY_MENU).
if (value is String) {
result[key] = replaced[value];
} else {
result[key] = value;
}
});
return result;
}
/// Parses entries from Chromium's HID code mapping header file.
///
/// Lines in this file look like this (without the ///):
......@@ -211,6 +272,8 @@ class Key {
this.androidKeyNames,
this.androidScanCodes,
this.androidKeyCodes,
this.glfwKeyNames,
this.glfwKeyCodes,
}) : assert(usbHidCode != null),
assert(chromiumName != null),
_constantName = enumName;
......@@ -261,6 +324,15 @@ class Key {
/// code value.
List<int> androidScanCodes;
/// The list of names that GFLW gives to this key (symbol names minus the
/// prefix).
List<String> glfwKeyNames;
/// The list of GLFW key codes matching this key, created by looking up the
/// Linux name in the Chromium data, and substituting the GLFW key code
/// value.
List<int> glfwKeyCodes;
/// Creates a JSON map from the key data.
Map<String, dynamic> toJson() {
return <String, dynamic>{
......@@ -269,6 +341,7 @@ class Key {
'android': androidKeyNames,
'english': commentName,
'chromium': chromiumName,
'glfw': glfwKeyNames,
},
'scanCodes': <String, dynamic>{
'android': androidScanCodes,
......@@ -280,6 +353,7 @@ class Key {
},
'keyCodes': <String, List<int>>{
'android': androidKeyCodes,
'glfw': glfwKeyCodes,
},
};
}
......@@ -337,8 +411,8 @@ class Key {
@override
String toString() {
return """'$constantName': (name: "$name", usbHidCode: ${toHex(usbHidCode)}, """
'''linuxKeyCode: ${toHex(linuxScanCode)}, xKbKeyCode: ${toHex(xKbScanCode)}, '''
'''windowsKeyCode: ${toHex(windowsScanCode)}, macOsKeyCode: ${toHex(macOsScanCode)}, '''
'''linuxScanCode: ${toHex(linuxScanCode)}, xKbScanCode: ${toHex(xKbScanCode)}, '''
'''windowsKeyCode: ${toHex(windowsScanCode)}, macOsScanCode: ${toHex(macOsScanCode)}, '''
'''chromiumSymbolName: $chromiumName''';
}
......
......@@ -24,6 +24,7 @@ export 'src/services/platform_views.dart';
export 'src/services/raw_keyboard.dart';
export 'src/services/raw_keyboard_android.dart';
export 'src/services/raw_keyboard_fuchsia.dart';
export 'src/services/raw_keyboard_linux.dart';
export 'src/services/raw_keyboard_macos.dart';
export 'src/services/system_channels.dart';
export 'src/services/system_chrome.dart';
......
......@@ -843,9 +843,7 @@ const Map<int, PhysicalKeyboardKey> kFuchsiaToPhysicalKey = <int, PhysicalKeyboa
0x000c028c: PhysicalKeyboardKey.mailSend,
};
/// Maps macOS-specific key code values representing [PhysicalKeyboardKey].
/// MacOS doesn't provide a scan code, but a virtual keycode to represent a physical key.
const Map<int, PhysicalKeyboardKey> kMacOsToPhysicalKey = <int, PhysicalKeyboardKey>{
0x00000000: PhysicalKeyboardKey.keyA,
0x0000000b: PhysicalKeyboardKey.keyB,
......@@ -989,3 +987,353 @@ const Map<int, LogicalKeyboardKey> kMacOsNumPadMap = <int, LogicalKeyboardKey>{
0x00000051: LogicalKeyboardKey.numpadEqual,
0x0000005f: LogicalKeyboardKey.numpadComma,
};
/// Maps GLFW-specific key codes to the matching [LogicalKeyboardKey].
const Map<int, LogicalKeyboardKey> kGlfwToLogicalKey = <int, LogicalKeyboardKey>{
65: LogicalKeyboardKey.keyA,
66: LogicalKeyboardKey.keyB,
67: LogicalKeyboardKey.keyC,
68: LogicalKeyboardKey.keyD,
69: LogicalKeyboardKey.keyE,
70: LogicalKeyboardKey.keyF,
71: LogicalKeyboardKey.keyG,
72: LogicalKeyboardKey.keyH,
73: LogicalKeyboardKey.keyI,
74: LogicalKeyboardKey.keyJ,
75: LogicalKeyboardKey.keyK,
76: LogicalKeyboardKey.keyL,
77: LogicalKeyboardKey.keyM,
78: LogicalKeyboardKey.keyN,
79: LogicalKeyboardKey.keyO,
80: LogicalKeyboardKey.keyP,
81: LogicalKeyboardKey.keyQ,
82: LogicalKeyboardKey.keyR,
83: LogicalKeyboardKey.keyS,
84: LogicalKeyboardKey.keyT,
85: LogicalKeyboardKey.keyU,
86: LogicalKeyboardKey.keyV,
87: LogicalKeyboardKey.keyW,
88: LogicalKeyboardKey.keyX,
89: LogicalKeyboardKey.keyY,
90: LogicalKeyboardKey.keyZ,
49: LogicalKeyboardKey.digit1,
50: LogicalKeyboardKey.digit2,
51: LogicalKeyboardKey.digit3,
52: LogicalKeyboardKey.digit4,
53: LogicalKeyboardKey.digit5,
54: LogicalKeyboardKey.digit6,
55: LogicalKeyboardKey.digit7,
56: LogicalKeyboardKey.digit8,
57: LogicalKeyboardKey.digit9,
48: LogicalKeyboardKey.digit0,
257: LogicalKeyboardKey.enter,
256: LogicalKeyboardKey.escape,
259: LogicalKeyboardKey.backspace,
258: LogicalKeyboardKey.tab,
32: LogicalKeyboardKey.space,
45: LogicalKeyboardKey.minus,
61: LogicalKeyboardKey.equal,
91: LogicalKeyboardKey.bracketLeft,
93: LogicalKeyboardKey.bracketRight,
92: LogicalKeyboardKey.backslash,
59: LogicalKeyboardKey.semicolon,
39: LogicalKeyboardKey.quote,
96: LogicalKeyboardKey.backquote,
44: LogicalKeyboardKey.comma,
46: LogicalKeyboardKey.period,
47: LogicalKeyboardKey.slash,
280: LogicalKeyboardKey.capsLock,
290: LogicalKeyboardKey.f1,
291: LogicalKeyboardKey.f2,
292: LogicalKeyboardKey.f3,
293: LogicalKeyboardKey.f4,
294: LogicalKeyboardKey.f5,
295: LogicalKeyboardKey.f6,
296: LogicalKeyboardKey.f7,
297: LogicalKeyboardKey.f8,
298: LogicalKeyboardKey.f9,
299: LogicalKeyboardKey.f10,
300: LogicalKeyboardKey.f11,
301: LogicalKeyboardKey.f12,
283: LogicalKeyboardKey.printScreen,
284: LogicalKeyboardKey.pause,
260: LogicalKeyboardKey.insert,
268: LogicalKeyboardKey.home,
266: LogicalKeyboardKey.pageUp,
261: LogicalKeyboardKey.delete,
269: LogicalKeyboardKey.end,
267: LogicalKeyboardKey.pageDown,
262: LogicalKeyboardKey.arrowRight,
263: LogicalKeyboardKey.arrowLeft,
264: LogicalKeyboardKey.arrowDown,
265: LogicalKeyboardKey.arrowUp,
282: LogicalKeyboardKey.numLock,
331: LogicalKeyboardKey.numpadDivide,
332: LogicalKeyboardKey.numpadMultiply,
334: LogicalKeyboardKey.numpadAdd,
335: LogicalKeyboardKey.numpadEnter,
321: LogicalKeyboardKey.numpad1,
322: LogicalKeyboardKey.numpad2,
323: LogicalKeyboardKey.numpad3,
324: LogicalKeyboardKey.numpad4,
325: LogicalKeyboardKey.numpad5,
326: LogicalKeyboardKey.numpad6,
327: LogicalKeyboardKey.numpad7,
328: LogicalKeyboardKey.numpad8,
329: LogicalKeyboardKey.numpad9,
320: LogicalKeyboardKey.numpad0,
330: LogicalKeyboardKey.numpadDecimal,
348: LogicalKeyboardKey.contextMenu,
336: LogicalKeyboardKey.numpadEqual,
302: LogicalKeyboardKey.f13,
303: LogicalKeyboardKey.f14,
304: LogicalKeyboardKey.f15,
305: LogicalKeyboardKey.f16,
306: LogicalKeyboardKey.f17,
307: LogicalKeyboardKey.f18,
308: LogicalKeyboardKey.f19,
309: LogicalKeyboardKey.f20,
310: LogicalKeyboardKey.f21,
311: LogicalKeyboardKey.f22,
312: LogicalKeyboardKey.f23,
341: LogicalKeyboardKey.controlLeft,
340: LogicalKeyboardKey.shiftLeft,
342: LogicalKeyboardKey.altLeft,
345: LogicalKeyboardKey.controlRight,
344: LogicalKeyboardKey.shiftRight,
346: LogicalKeyboardKey.altRight,
};
/// A map of GLFW key codes which have printable representations, but appear
/// on the number pad. Used to provide different key objects for keys like
/// KEY_EQUALS and NUMPAD_EQUALS.
const Map<int, LogicalKeyboardKey> kGlfwNumpadMap = <int, LogicalKeyboardKey>{
331: LogicalKeyboardKey.numpadDivide,
332: LogicalKeyboardKey.numpadMultiply,
334: LogicalKeyboardKey.numpadAdd,
321: LogicalKeyboardKey.numpad1,
322: LogicalKeyboardKey.numpad2,
323: LogicalKeyboardKey.numpad3,
324: LogicalKeyboardKey.numpad4,
325: LogicalKeyboardKey.numpad5,
326: LogicalKeyboardKey.numpad6,
327: LogicalKeyboardKey.numpad7,
328: LogicalKeyboardKey.numpad8,
329: LogicalKeyboardKey.numpad9,
320: LogicalKeyboardKey.numpad0,
330: LogicalKeyboardKey.numpadDecimal,
336: LogicalKeyboardKey.numpadEqual,
};
/// Maps XKB specific key code values representing [PhysicalKeyboardKey].
const Map<int, PhysicalKeyboardKey> kLinuxToPhysicalKey = <int, PhysicalKeyboardKey>{
0x0000024f: PhysicalKeyboardKey.launchAssistant,
0x00000096: PhysicalKeyboardKey.sleep,
0x00000097: PhysicalKeyboardKey.wakeUp,
0x00000026: PhysicalKeyboardKey.keyA,
0x00000038: PhysicalKeyboardKey.keyB,
0x00000036: PhysicalKeyboardKey.keyC,
0x00000028: PhysicalKeyboardKey.keyD,
0x0000001a: PhysicalKeyboardKey.keyE,
0x00000029: PhysicalKeyboardKey.keyF,
0x0000002a: PhysicalKeyboardKey.keyG,
0x0000002b: PhysicalKeyboardKey.keyH,
0x0000001f: PhysicalKeyboardKey.keyI,
0x0000002c: PhysicalKeyboardKey.keyJ,
0x0000002d: PhysicalKeyboardKey.keyK,
0x0000002e: PhysicalKeyboardKey.keyL,
0x0000003a: PhysicalKeyboardKey.keyM,
0x00000039: PhysicalKeyboardKey.keyN,
0x00000020: PhysicalKeyboardKey.keyO,
0x00000021: PhysicalKeyboardKey.keyP,
0x00000018: PhysicalKeyboardKey.keyQ,
0x0000001b: PhysicalKeyboardKey.keyR,
0x00000027: PhysicalKeyboardKey.keyS,
0x0000001c: PhysicalKeyboardKey.keyT,
0x0000001e: PhysicalKeyboardKey.keyU,
0x00000037: PhysicalKeyboardKey.keyV,
0x00000019: PhysicalKeyboardKey.keyW,
0x00000035: PhysicalKeyboardKey.keyX,
0x0000001d: PhysicalKeyboardKey.keyY,
0x00000034: PhysicalKeyboardKey.keyZ,
0x0000000a: PhysicalKeyboardKey.digit1,
0x0000000b: PhysicalKeyboardKey.digit2,
0x0000000c: PhysicalKeyboardKey.digit3,
0x0000000d: PhysicalKeyboardKey.digit4,
0x0000000e: PhysicalKeyboardKey.digit5,
0x0000000f: PhysicalKeyboardKey.digit6,
0x00000010: PhysicalKeyboardKey.digit7,
0x00000011: PhysicalKeyboardKey.digit8,
0x00000012: PhysicalKeyboardKey.digit9,
0x00000013: PhysicalKeyboardKey.digit0,
0x00000024: PhysicalKeyboardKey.enter,
0x00000009: PhysicalKeyboardKey.escape,
0x00000016: PhysicalKeyboardKey.backspace,
0x00000017: PhysicalKeyboardKey.tab,
0x00000041: PhysicalKeyboardKey.space,
0x00000014: PhysicalKeyboardKey.minus,
0x00000015: PhysicalKeyboardKey.equal,
0x00000022: PhysicalKeyboardKey.bracketLeft,
0x00000023: PhysicalKeyboardKey.bracketRight,
0x00000033: PhysicalKeyboardKey.backslash,
0x0000002f: PhysicalKeyboardKey.semicolon,
0x00000030: PhysicalKeyboardKey.quote,
0x00000031: PhysicalKeyboardKey.backquote,
0x0000003b: PhysicalKeyboardKey.comma,
0x0000003c: PhysicalKeyboardKey.period,
0x0000003d: PhysicalKeyboardKey.slash,
0x00000042: PhysicalKeyboardKey.capsLock,
0x00000043: PhysicalKeyboardKey.f1,
0x00000044: PhysicalKeyboardKey.f2,
0x00000045: PhysicalKeyboardKey.f3,
0x00000046: PhysicalKeyboardKey.f4,
0x00000047: PhysicalKeyboardKey.f5,
0x00000048: PhysicalKeyboardKey.f6,
0x00000049: PhysicalKeyboardKey.f7,
0x0000004a: PhysicalKeyboardKey.f8,
0x0000004b: PhysicalKeyboardKey.f9,
0x0000004c: PhysicalKeyboardKey.f10,
0x0000005f: PhysicalKeyboardKey.f11,
0x00000060: PhysicalKeyboardKey.f12,
0x0000006b: PhysicalKeyboardKey.printScreen,
0x0000004e: PhysicalKeyboardKey.scrollLock,
0x0000007f: PhysicalKeyboardKey.pause,
0x00000076: PhysicalKeyboardKey.insert,
0x0000006e: PhysicalKeyboardKey.home,
0x00000070: PhysicalKeyboardKey.pageUp,
0x00000077: PhysicalKeyboardKey.delete,
0x00000073: PhysicalKeyboardKey.end,
0x00000075: PhysicalKeyboardKey.pageDown,
0x00000072: PhysicalKeyboardKey.arrowRight,
0x00000071: PhysicalKeyboardKey.arrowLeft,
0x00000074: PhysicalKeyboardKey.arrowDown,
0x0000006f: PhysicalKeyboardKey.arrowUp,
0x0000004d: PhysicalKeyboardKey.numLock,
0x0000006a: PhysicalKeyboardKey.numpadDivide,
0x0000003f: PhysicalKeyboardKey.numpadMultiply,
0x00000052: PhysicalKeyboardKey.numpadSubtract,
0x00000056: PhysicalKeyboardKey.numpadAdd,
0x00000068: PhysicalKeyboardKey.numpadEnter,
0x00000057: PhysicalKeyboardKey.numpad1,
0x00000058: PhysicalKeyboardKey.numpad2,
0x00000059: PhysicalKeyboardKey.numpad3,
0x00000053: PhysicalKeyboardKey.numpad4,
0x00000054: PhysicalKeyboardKey.numpad5,
0x00000055: PhysicalKeyboardKey.numpad6,
0x0000004f: PhysicalKeyboardKey.numpad7,
0x00000050: PhysicalKeyboardKey.numpad8,
0x00000051: PhysicalKeyboardKey.numpad9,
0x0000005a: PhysicalKeyboardKey.numpad0,
0x0000005b: PhysicalKeyboardKey.numpadDecimal,
0x0000005e: PhysicalKeyboardKey.intlBackslash,
0x00000087: PhysicalKeyboardKey.contextMenu,
0x0000007c: PhysicalKeyboardKey.power,
0x0000007d: PhysicalKeyboardKey.numpadEqual,
0x000000bf: PhysicalKeyboardKey.f13,
0x000000c0: PhysicalKeyboardKey.f14,
0x000000c1: PhysicalKeyboardKey.f15,
0x000000c2: PhysicalKeyboardKey.f16,
0x000000c3: PhysicalKeyboardKey.f17,
0x000000c4: PhysicalKeyboardKey.f18,
0x000000c5: PhysicalKeyboardKey.f19,
0x000000c6: PhysicalKeyboardKey.f20,
0x000000c7: PhysicalKeyboardKey.f21,
0x000000c8: PhysicalKeyboardKey.f22,
0x000000c9: PhysicalKeyboardKey.f23,
0x000000ca: PhysicalKeyboardKey.f24,
0x0000008e: PhysicalKeyboardKey.open,
0x00000092: PhysicalKeyboardKey.help,
0x0000008c: PhysicalKeyboardKey.select,
0x00000089: PhysicalKeyboardKey.again,
0x0000008b: PhysicalKeyboardKey.undo,
0x00000091: PhysicalKeyboardKey.cut,
0x0000008d: PhysicalKeyboardKey.copy,
0x0000008f: PhysicalKeyboardKey.paste,
0x00000090: PhysicalKeyboardKey.find,
0x00000079: PhysicalKeyboardKey.audioVolumeMute,
0x0000007b: PhysicalKeyboardKey.audioVolumeUp,
0x0000007a: PhysicalKeyboardKey.audioVolumeDown,
0x00000081: PhysicalKeyboardKey.numpadComma,
0x00000061: PhysicalKeyboardKey.intlRo,
0x00000065: PhysicalKeyboardKey.kanaMode,
0x00000084: PhysicalKeyboardKey.intlYen,
0x00000064: PhysicalKeyboardKey.convert,
0x00000066: PhysicalKeyboardKey.nonConvert,
0x00000082: PhysicalKeyboardKey.lang1,
0x00000083: PhysicalKeyboardKey.lang2,
0x00000062: PhysicalKeyboardKey.lang3,
0x00000063: PhysicalKeyboardKey.lang4,
0x0000005d: PhysicalKeyboardKey.lang5,
0x000000bb: PhysicalKeyboardKey.numpadParenLeft,
0x000000bc: PhysicalKeyboardKey.numpadParenRight,
0x0000007e: PhysicalKeyboardKey.numpadSignChange,
0x00000025: PhysicalKeyboardKey.controlLeft,
0x00000032: PhysicalKeyboardKey.shiftLeft,
0x00000040: PhysicalKeyboardKey.altLeft,
0x00000085: PhysicalKeyboardKey.metaLeft,
0x00000069: PhysicalKeyboardKey.controlRight,
0x0000003e: PhysicalKeyboardKey.shiftRight,
0x0000006c: PhysicalKeyboardKey.altRight,
0x00000086: PhysicalKeyboardKey.metaRight,
0x0000016e: PhysicalKeyboardKey.info,
0x0000017a: PhysicalKeyboardKey.closedCaptionToggle,
0x000000e9: PhysicalKeyboardKey.brightnessUp,
0x000000e8: PhysicalKeyboardKey.brightnessDown,
0x000001b7: PhysicalKeyboardKey.brightnessToggle,
0x00000258: PhysicalKeyboardKey.brightnessMinimum,
0x00000259: PhysicalKeyboardKey.brightnessMaximum,
0x000000fc: PhysicalKeyboardKey.brightnessAuto,
0x0000019d: PhysicalKeyboardKey.mediaLast,
0x000000b1: PhysicalKeyboardKey.launchPhone,
0x00000172: PhysicalKeyboardKey.programGuide,
0x000000b6: PhysicalKeyboardKey.exit,
0x000001a2: PhysicalKeyboardKey.channelUp,
0x000001a3: PhysicalKeyboardKey.channelDown,
0x000000d7: PhysicalKeyboardKey.mediaPlay,
0x000000af: PhysicalKeyboardKey.mediaRecord,
0x000000d8: PhysicalKeyboardKey.mediaFastForward,
0x000000b0: PhysicalKeyboardKey.mediaRewind,
0x000000ab: PhysicalKeyboardKey.mediaTrackNext,
0x000000ad: PhysicalKeyboardKey.mediaTrackPrevious,
0x000000ae: PhysicalKeyboardKey.mediaStop,
0x000000a9: PhysicalKeyboardKey.eject,
0x000000ac: PhysicalKeyboardKey.mediaPlayPause,
0x0000024e: PhysicalKeyboardKey.speechInputToggle,
0x000000d9: PhysicalKeyboardKey.bassBoost,
0x000000b3: PhysicalKeyboardKey.mediaSelect,
0x000001ad: PhysicalKeyboardKey.launchWordProcessor,
0x000001af: PhysicalKeyboardKey.launchSpreadsheet,
0x000000a3: PhysicalKeyboardKey.launchMail,
0x000001b5: PhysicalKeyboardKey.launchContacts,
0x00000195: PhysicalKeyboardKey.launchCalendar,
0x00000094: PhysicalKeyboardKey.launchApp2,
0x00000098: PhysicalKeyboardKey.launchApp1,
0x0000009e: PhysicalKeyboardKey.launchInternetBrowser,
0x000001b9: PhysicalKeyboardKey.logOff,
0x000000a0: PhysicalKeyboardKey.lockScreen,
0x0000024b: PhysicalKeyboardKey.launchControlPanel,
0x0000024c: PhysicalKeyboardKey.selectTask,
0x000000f3: PhysicalKeyboardKey.launchDocuments,
0x000001b8: PhysicalKeyboardKey.spellCheck,
0x0000017e: PhysicalKeyboardKey.launchKeyboardLayout,
0x0000024d: PhysicalKeyboardKey.launchScreenSaver,
0x00000190: PhysicalKeyboardKey.launchAudioBrowser,
0x000000bd: PhysicalKeyboardKey.newKey,
0x000000d6: PhysicalKeyboardKey.close,
0x000000f2: PhysicalKeyboardKey.save,
0x000000da: PhysicalKeyboardKey.print,
0x000000e1: PhysicalKeyboardKey.browserSearch,
0x000000b4: PhysicalKeyboardKey.browserHome,
0x000000a6: PhysicalKeyboardKey.browserBack,
0x000000a7: PhysicalKeyboardKey.browserForward,
0x00000088: PhysicalKeyboardKey.browserStop,
0x000000b5: PhysicalKeyboardKey.browserRefresh,
0x000000a4: PhysicalKeyboardKey.browserFavorites,
0x000001aa: PhysicalKeyboardKey.zoomIn,
0x000001ab: PhysicalKeyboardKey.zoomOut,
0x000000be: PhysicalKeyboardKey.redo,
0x000000f0: PhysicalKeyboardKey.mailReply,
0x000000f1: PhysicalKeyboardKey.mailForward,
0x000000ef: PhysicalKeyboardKey.mailSend,
};
......@@ -9,6 +9,7 @@ import 'package:flutter/foundation.dart';
import 'keyboard_key.dart';
import 'raw_keyboard_android.dart';
import 'raw_keyboard_fuchsia.dart';
import 'raw_keyboard_linux.dart';
import 'raw_keyboard_macos.dart';
import 'system_channels.dart';
......@@ -272,6 +273,14 @@ abstract class RawKeyEvent {
keyCode: message['keyCode'] ?? 0,
modifiers: message['modifiers'] ?? 0);
break;
case 'linux':
data = RawKeyEventDataLinux(
keyHelper: KeyHelper(message['toolkit'] ?? ''),
codePoint: message['codePoint'] ?? 0,
keyCode: message['keyCode'] ?? 0,
scanCode: message['scanCode'] ?? 0,
modifiers: message['modifiers'] ?? 0);
break;
default:
// We don't yet implement raw key events on iOS or other platforms, but
// we don't hit this exception because the engine never sends us these
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/foundation.dart';
import 'keyboard_key.dart';
import 'keyboard_maps.dart';
import 'raw_keyboard.dart';
/// Platform-specific key event data for Linux.
///
/// Different window toolkit implementations can map to different key codes. This class
/// will use the correct mapping depending on the [toolkit] provided.
///
/// See also:
///
/// * [RawKeyboard], which uses this interface to expose key data.
class RawKeyEventDataLinux extends RawKeyEventData {
/// Creates a key event data structure specific for macOS.
///
/// The [toolkit], [scanCode], [codePoint], [keyCode], and [modifiers], arguments
/// must not be null.
const RawKeyEventDataLinux({
@required this.keyHelper,
this.scanCode = 0,
this.codePoint = 0,
this.keyCode = 0,
this.modifiers = 0,
}) : assert(scanCode != null),
assert(codePoint != null),
assert(keyCode != null),
assert(modifiers != null),
assert(keyHelper != null);
/// A helper class that abstracts the fetching of the toolkit-specific mappings.
///
/// There is no real concept of a "native" window toolkit on Linux, and each implementation
/// (GLFW, GTK, QT, etc) may have a different key code mapping.
final KeyHelper keyHelper;
/// The hardware scan code id corresponding to this key event.
///
/// These values are not reliable and vary from device to device, so this
/// information is mainly useful for debugging.
final int scanCode;
/// The Unicode code point represented by the key event, if any.
///
/// If there is no Unicode code point, this value is zero.
///
/// Dead keys are represented as Unicode combining characters.
final int codePoint;
/// The hardware key code corresponding to this key event.
///
/// This is the physical key that was pressed, not the Unicode character.
/// See [codePoint] for the Unicode character. This value may be different depending
/// on the window toolkit used (See [toolkit]).
final int keyCode;
/// A mask of the current modifiers using the values in Modifier Flags.
/// This value may be different depending on the window toolkit used (See [toolkit]).
final int modifiers;
@override
String get keyLabel => codePoint == 0 ? null : String.fromCharCode(codePoint);
@override
PhysicalKeyboardKey get physicalKey => kLinuxToPhysicalKey[scanCode] ?? PhysicalKeyboardKey.none;
@override
LogicalKeyboardKey get logicalKey {
// Look to see if the keyCode is a printable number pad key, so that a
// difference between regular keys (e.g. "=") and the number pad version
// (e.g. the "=" on the number pad) can be determined.
final LogicalKeyboardKey numPadKey = keyHelper.numpadKey(keyCode);
if (numPadKey != null) {
return numPadKey;
}
// If it has a non-control-character label, then either return the existing
// constant, or construct a new Unicode-based key from it. Don't mark it as
// autogenerated, since the label uniquely identifies an ID from the Unicode
// plane.
if (keyLabel != null &&
!LogicalKeyboardKey.isControlCharacter(keyLabel)) {
final int keyId = LogicalKeyboardKey.unicodePlane | (codePoint & LogicalKeyboardKey.valueMask);
return LogicalKeyboardKey.findKeyByKeyId(keyId) ?? LogicalKeyboardKey(
keyId,
keyLabel: keyLabel,
debugName: kReleaseMode ? null : 'Key ${keyLabel.toUpperCase()}',
);
}
// Look to see if the keyCode is one we know about and have a mapping for.
LogicalKeyboardKey newKey = keyHelper.logicalKey(keyCode);
if (newKey != null) {
return newKey;
}
const int linuxKeyIdPlane = 0x00600000000;
// This is a non-printable key that we don't know about, so we mint a new
// code with the autogenerated bit set.
newKey ??= LogicalKeyboardKey(
linuxKeyIdPlane | keyCode | LogicalKeyboardKey.autogeneratedMask,
debugName: kReleaseMode ? null : 'Unknown key code $keyCode',
);
return newKey;
}
@override
bool isModifierPressed(ModifierKey key, {KeyboardSide side = KeyboardSide.any}) {
return keyHelper.isModifierPressed(key, modifiers, side: side);
}
@override
KeyboardSide getModifierSide(ModifierKey key) {
return keyHelper.getModifierSide(key);
}
@override
String toString() {
return '$runtimeType(keyLabel: $keyLabel, keyCode: $keyCode, scanCode: $scanCode,'
' codePoint: $codePoint, modifiers: $modifiers, '
'modifiers down: $modifiersPressed)';
}
}
/// Abstract class for window-specific key mappings.
///
/// Given that there might be multiple window toolkit implementations (GLFW,
/// GTK, QT, etc), this creates a common interface for each of the
/// different toolkits.
abstract class KeyHelper {
/// Create a KeyHelper implementation depending on the given toolkit.
factory KeyHelper(String toolkit) {
if (toolkit == 'glfw') {
return GLFWKeyHelper();
} else {
throw FlutterError('Window toolkit not recognized: $toolkit');
}
}
/// Returns a [KeyboardSide] enum value that describes which side or sides of
/// the given keyboard modifier key were pressed at the time of this event.
KeyboardSide getModifierSide(ModifierKey key);
/// Returns true if the given [ModifierKey] was pressed at the time of this
/// event.
bool isModifierPressed(ModifierKey key, int modifiers, {KeyboardSide side = KeyboardSide.any});
/// The numpad key from the specific key code mapping.
LogicalKeyboardKey numpadKey(int keyCode);
/// The logical key key from the specific key code mapping.
LogicalKeyboardKey logicalKey(int keyCode);
}
/// Helper class that uses GLFW-specific key mappings.
class GLFWKeyHelper with KeyHelper {
/// This mask is used to check the [modifiers] field to test whether the CAPS
/// LOCK modifier key is on.
///
/// {@template flutter.services.logicalKeyboardKey.modifiers}
/// Use this value if you need to decode the [modifiers] field yourself, but
/// it's much easier to use [isModifierPressed] if you just want to know if
/// a modifier is pressed.
/// {@endtemplate}
static const int modifierCapsLock = 0x0010;
/// This mask is used to check the [modifiers] field to test whether one of the
/// SHIFT modifier keys is pressed.
///
/// {@macro flutter.services.logicalKeyboardKey.modifiers}
static const int modifierShift = 0x0001;
/// This mask is used to check the [modifiers] field to test whether one of the
/// CTRL modifier keys is pressed.
///
/// {@macro flutter.services.logicalKeyboardKey.modifiers}
static const int modifierControl = 0x0002;
/// This mask is used to check the [modifiers] field to test whether one of the
/// ALT modifier keys is pressed.
///
/// {@macro flutter.services.logicalKeyboardKey.modifiers}
static const int modifierAlt = 0x0004;
/// This mask is used to check the [modifiers] field to test whether one of the
/// Meta(SUPER) modifier keys is pressed.
///
/// {@macro flutter.services.logicalKeyboardKey.modifiers}
static const int modifierMeta = 0x0008;
/// This mask is used to check the [modifiers] field to test whether any key in
/// the numeric keypad is pressed.
///
/// {@macro flutter.services.logicalKeyboardKey.modifiers}
static const int modifierNumericPad = 0x0020;
@override
bool isModifierPressed(ModifierKey key, int modifiers, {KeyboardSide side = KeyboardSide.any}) {
switch (key) {
case ModifierKey.controlModifier:
return modifiers & modifierControl != 0;
case ModifierKey.shiftModifier:
return modifiers & modifierShift != 0;
case ModifierKey.altModifier:
return modifiers & modifierAlt != 0;
case ModifierKey.metaModifier:
return modifiers & modifierMeta != 0;
case ModifierKey.capsLockModifier:
return modifiers & modifierCapsLock != 0;
case ModifierKey.numLockModifier:
return modifiers & modifierNumericPad != 0;
case ModifierKey.functionModifier:
case ModifierKey.symbolModifier:
case ModifierKey.scrollLockModifier:
// These are not used in GLFW keyboards.
return false;
}
return false;
}
@override
KeyboardSide getModifierSide(ModifierKey key) {
switch (key) {
case ModifierKey.controlModifier:
case ModifierKey.shiftModifier:
case ModifierKey.altModifier:
case ModifierKey.metaModifier:
// Neither GLFW or X11 provide a distiction between left and right modifiers, so defaults to KeyboardSide.any.
// https://code.woboq.org/qt5/include/X11/X.h.html#_M/ShiftMask
return KeyboardSide.any;
case ModifierKey.capsLockModifier:
case ModifierKey.numLockModifier:
case ModifierKey.functionModifier:
case ModifierKey.symbolModifier:
case ModifierKey.scrollLockModifier:
return KeyboardSide.all;
}
assert(false, 'Not handling $key type properly.');
return null;
}
@override
LogicalKeyboardKey numpadKey(int keyCode) {
return kGlfwNumpadMap[keyCode];
}
@override
LogicalKeyboardKey logicalKey(int keyCode) {
return kGlfwToLogicalKey[keyCode];
}
}
......@@ -92,7 +92,7 @@ void main() {
expect(
data.isModifierPressed(key, side: modifierTests[modifier].side),
isFalse,
reason: '$key should not be pressed with metaState $modifier with metaState $modifier '
reason: '$key should not be pressed with metaState $modifier '
'and additional key ${RawKeyEventDataAndroid.modifierFunction}.',
);
}
......@@ -340,7 +340,7 @@ void main() {
expect(
data.isModifierPressed(key, side: modifierTests[modifier].side),
isFalse,
reason: '$key should not be pressed with metaState $modifier with metaState $modifier '
reason: '$key should not be pressed with metaState $modifier '
'and additional key ${RawKeyEventDataMacOs.modifierFunction}.',
);
}
......@@ -393,4 +393,129 @@ void main() {
expect(data.keyLabel, isNull);
});
});
group('RawKeyEventDataLinux-GFLW', () {
const Map<int, _ModifierCheck> modifierTests = <int, _ModifierCheck>{
GLFWKeyHelper.modifierAlt: _ModifierCheck(ModifierKey.altModifier, KeyboardSide.any),
GLFWKeyHelper.modifierShift: _ModifierCheck(ModifierKey.shiftModifier, KeyboardSide.any),
GLFWKeyHelper.modifierControl: _ModifierCheck(ModifierKey.controlModifier, KeyboardSide.any),
GLFWKeyHelper.modifierMeta: _ModifierCheck(ModifierKey.metaModifier, KeyboardSide.any),
GLFWKeyHelper.modifierNumericPad: _ModifierCheck(ModifierKey.numLockModifier, KeyboardSide.all),
GLFWKeyHelper.modifierCapsLock: _ModifierCheck(ModifierKey.capsLockModifier, KeyboardSide.all),
};
test('modifier keys are recognized individually', () {
for (int modifier in modifierTests.keys) {
final RawKeyEvent event = RawKeyEvent.fromMessage(<String, dynamic>{
'type': 'keydown',
'keymap': 'linux',
'toolkit': 'glfw',
'keyCode': 0x04,
'scanCode': 0x01,
'codePoint': 0x10,
'modifiers': modifier,
});
final RawKeyEventDataLinux data = event.data;
for (ModifierKey key in ModifierKey.values) {
if (modifierTests[modifier].key == key) {
expect(
data.isModifierPressed(key, side: modifierTests[modifier].side),
isTrue,
reason: "$key should be pressed with metaState $modifier, but isn't.",
);
expect(data.getModifierSide(key), equals(modifierTests[modifier].side));
} else {
expect(
data.isModifierPressed(key, side: modifierTests[modifier].side),
isFalse,
reason: '$key should not be pressed with metaState $modifier.',
);
}
}
}
});
test('modifier keys are recognized when combined', () {
for (int modifier in modifierTests.keys) {
if (modifier == GLFWKeyHelper.modifierControl) {
// No need to combine CTRL key with itself.
continue;
}
final RawKeyEvent event = RawKeyEvent.fromMessage(<String, dynamic>{
'type': 'keydown',
'keymap': 'linux',
'toolkit': 'glfw',
'keyCode': 0x04,
'scanCode': 0x64,
'codePoint': 0x1,
'modifiers': modifier | GLFWKeyHelper.modifierControl,
});
final RawKeyEventDataLinux data = event.data;
for (ModifierKey key in ModifierKey.values) {
if (modifierTests[modifier].key == key || key == ModifierKey.controlModifier) {
expect(
data.isModifierPressed(key, side: modifierTests[modifier].side),
isTrue,
reason: '$key should be pressed with metaState $modifier '
"and additional key ${GLFWKeyHelper.modifierControl}, but isn't.",
);
if (key != ModifierKey.controlModifier) {
expect(data.getModifierSide(key), equals(modifierTests[modifier].side));
} else {
expect(data.getModifierSide(key), equals(KeyboardSide.any));
}
} else {
expect(
data.isModifierPressed(key, side: modifierTests[modifier].side),
isFalse,
reason: '$key should not be pressed with metaState $modifier '
'and additional key ${GLFWKeyHelper.modifierControl}.',
);
}
}
}
});
test('Printable keyboard keys are correctly translated', () {
final RawKeyEvent keyAEvent = RawKeyEvent.fromMessage(const <String, dynamic>{
'type': 'keydown',
'keymap': 'linux',
'toolkit': 'glfw',
'keyCode': 65,
'scanCode': 0x00000026,
'codePoint': 97,
'modifiers': 0x0,
});
final RawKeyEventDataLinux data = keyAEvent.data;
expect(data.physicalKey, equals(PhysicalKeyboardKey.keyA));
expect(data.logicalKey, equals(LogicalKeyboardKey.keyA));
expect(data.keyLabel, equals('a'));
});
test('Control keyboard keys are correctly translated', () {
final RawKeyEvent escapeKeyEvent = RawKeyEvent.fromMessage(const <String, dynamic>{
'type': 'keydown',
'keymap': 'linux',
'toolkit': 'glfw',
'keyCode': 256,
'scanCode': 0x00000009,
'codePoint': 0,
'modifiers': 0x0,
});
final RawKeyEventDataLinux data = escapeKeyEvent.data;
expect(data.physicalKey, equals(PhysicalKeyboardKey.escape));
expect(data.logicalKey, equals(LogicalKeyboardKey.escape));
expect(data.keyLabel, isNull);
});
test('Modifier keyboard keys are correctly translated', () {
final RawKeyEvent shiftLeftKeyEvent = RawKeyEvent.fromMessage(const <String, dynamic>{
'type': 'keydown',
'keymap': 'linux',
'toolkit': 'glfw',
'keyCode': 340,
'scanCode': 0x00000032,
'codePoint': 0,
});
final RawKeyEventDataLinux data = shiftLeftKeyEvent.data;
expect(data.physicalKey, equals(PhysicalKeyboardKey.shiftLeft));
expect(data.logicalKey, equals(LogicalKeyboardKey.shiftLeft));
expect(data.keyLabel, isNull);
});
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment