From 857fe320e0b84b8844c61c5eeb3e4e9f1bae2379 Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Tue, 16 Apr 2019 08:02:11 -0700 Subject: [PATCH] Update keycodes, fix a comment. (#30938) Updates the keycodes by regenerating them using the script, and fixed a comment in the template to conform to style. --- dev/tools/gen_keycodes/data/key_data.json | 96 +++++++++++++------ .../gen_keycodes/data/keyboard_maps.tmpl | 2 + .../lib/src/services/keyboard_key.dart | 52 +++++++--- .../lib/src/services/keyboard_maps.dart | 17 +++- 4 files changed, 123 insertions(+), 44 deletions(-) diff --git a/dev/tools/gen_keycodes/data/key_data.json b/dev/tools/gen_keycodes/data/key_data.json index 88dd40b993..ea6d4d9cae 100644 --- a/dev/tools/gen_keycodes/data/key_data.json +++ b/dev/tools/gen_keycodes/data/key_data.json @@ -181,31 +181,6 @@ "glfw": null } }, - "launchAssistant": { - "names": { - "domkey": "LaunchAssistant", - "android": [ - "ASSIST" - ], - "english": "Launch Assistant", - "chromium": "launchAssistant", - "glfw": null - }, - "scanCodes": { - "android": null, - "usb": 23, - "linux": 583, - "xkb": 591, - "windows": null, - "macos": null - }, - "keyCodes": { - "android": [ - 219 - ], - "glfw": null - } - }, "sleep": { "names": { "domkey": "Sleep", @@ -260,6 +235,27 @@ "glfw": null } }, + "displayToggleIntExt": { + "names": { + "domkey": "DisplayToggleIntExt", + "android": null, + "english": "Display Toggle Int Ext", + "chromium": "displayToggleIntExt", + "glfw": null + }, + "scanCodes": { + "android": null, + "usb": 65717, + "linux": 227, + "xkb": 235, + "windows": null, + "macos": null + }, + "keyCodes": { + "android": null, + "glfw": null + } + }, "usbReserved": { "names": { "domkey": null, @@ -5844,6 +5840,31 @@ "glfw": null } }, + "launchAssistant": { + "names": { + "domkey": "LaunchAssistant", + "android": [ + "ASSIST" + ], + "english": "Launch Assistant", + "chromium": "launchAssistant", + "glfw": null + }, + "scanCodes": { + "android": null, + "usb": 786891, + "linux": 583, + "xkb": 591, + "windows": null, + "macos": null + }, + "keyCodes": { + "android": [ + 219 + ], + "glfw": null + } + }, "launchAudioBrowser": { "names": { "domkey": null, @@ -6193,8 +6214,8 @@ "scanCodes": { "android": null, "usb": 786994, - "linux": null, - "xkb": null, + "linux": 372, + "xkb": 380, "windows": null, "macos": null }, @@ -6292,5 +6313,26 @@ "android": null, "glfw": null } + }, + "showAllWindows": { + "names": { + "domkey": "ShowAllWindows", + "android": null, + "english": "Show All Windows", + "chromium": "showAllWindows", + "glfw": null + }, + "scanCodes": { + "android": null, + "usb": 787103, + "linux": 120, + "xkb": 128, + "windows": null, + "macos": null + }, + "keyCodes": { + "android": null, + "glfw": null + } } } \ No newline at end of file diff --git a/dev/tools/gen_keycodes/data/keyboard_maps.tmpl b/dev/tools/gen_keycodes/data/keyboard_maps.tmpl index b390043c15..3dd9ac2afb 100644 --- a/dev/tools/gen_keycodes/data/keyboard_maps.tmpl +++ b/dev/tools/gen_keycodes/data/keyboard_maps.tmpl @@ -40,6 +40,8 @@ const Map kFuchsiaToPhysicalKey = kMacOsToPhysicalKey = { @@@MACOS_SCAN_CODE_MAP@@@ }; diff --git a/packages/flutter/lib/src/services/keyboard_key.dart b/packages/flutter/lib/src/services/keyboard_key.dart index d04c35b31a..2064013dc8 100644 --- a/packages/flutter/lib/src/services/keyboard_key.dart +++ b/packages/flutter/lib/src/services/keyboard_key.dart @@ -283,11 +283,6 @@ class LogicalKeyboardKey extends Diagnosticable { /// See the function [RawKeyEvent.logicalKey] for more information. static const LogicalKeyboardKey turbo = LogicalKeyboardKey(0x00100000016, debugName: kReleaseMode ? null : 'Turbo'); - /// Represents the logical "Launch Assistant" key on the keyboard. - /// - /// See the function [RawKeyEvent.logicalKey] for more information. - static const LogicalKeyboardKey launchAssistant = LogicalKeyboardKey(0x00100000017, debugName: kReleaseMode ? null : 'Launch Assistant'); - /// Represents the logical "Sleep" key on the keyboard. /// /// See the function [RawKeyEvent.logicalKey] for more information. @@ -298,6 +293,11 @@ class LogicalKeyboardKey extends Diagnosticable { /// See the function [RawKeyEvent.logicalKey] for more information. static const LogicalKeyboardKey wakeUp = LogicalKeyboardKey(0x00100010083, debugName: kReleaseMode ? null : 'Wake Up'); + /// Represents the logical "Display Toggle Int Ext" key on the keyboard. + /// + /// See the function [RawKeyEvent.logicalKey] for more information. + static const LogicalKeyboardKey displayToggleIntExt = LogicalKeyboardKey(0x001000100b5, debugName: kReleaseMode ? null : 'Display Toggle Int Ext'); + /// Represents the logical "Usb Reserved" key on the keyboard. /// /// See the function [RawKeyEvent.logicalKey] for more information. @@ -1303,6 +1303,11 @@ class LogicalKeyboardKey extends Diagnosticable { /// See the function [RawKeyEvent.logicalKey] for more information. static const LogicalKeyboardKey launchScreenSaver = LogicalKeyboardKey(0x001000c01b1, debugName: kReleaseMode ? null : 'Launch Screen Saver'); + /// Represents the logical "Launch Assistant" key on the keyboard. + /// + /// See the function [RawKeyEvent.logicalKey] for more information. + static const LogicalKeyboardKey launchAssistant = LogicalKeyboardKey(0x001000c01cb, debugName: kReleaseMode ? null : 'Launch Assistant'); + /// Represents the logical "Launch Audio Browser" key on the keyboard. /// /// See the function [RawKeyEvent.logicalKey] for more information. @@ -1398,6 +1403,11 @@ class LogicalKeyboardKey extends Diagnosticable { /// See the function [RawKeyEvent.logicalKey] for more information. static const LogicalKeyboardKey mailSend = LogicalKeyboardKey(0x001000c028c, debugName: kReleaseMode ? null : 'Mail Send'); + /// Represents the logical "Show All Windows" key on the keyboard. + /// + /// See the function [RawKeyEvent.logicalKey] for more information. + static const LogicalKeyboardKey showAllWindows = LogicalKeyboardKey(0x001000c029f, debugName: kReleaseMode ? null : 'Show All Windows'); + // A list of all predefined constant LogicalKeyboardKeys so they can be // searched. static const Map _knownLogicalKeys = { @@ -1409,9 +1419,9 @@ class LogicalKeyboardKey extends Diagnosticable { 0x0100000014: suspend, 0x0100000015: resume, 0x0100000016: turbo, - 0x0100000017: launchAssistant, 0x0100010082: sleep, 0x0100010083: wakeUp, + 0x01000100b5: displayToggleIntExt, 0x0100070000: usbReserved, 0x0100070001: usbErrorRollOver, 0x0100070002: usbPostFail, @@ -1613,6 +1623,7 @@ class LogicalKeyboardKey extends Diagnosticable { 0x01000c01ab: spellCheck, 0x01000c01ae: launchKeyboardLayout, 0x01000c01b1: launchScreenSaver, + 0x01000c01cb: launchAssistant, 0x01000c01b7: launchAudioBrowser, 0x01000c0201: newKey, 0x01000c0203: close, @@ -1632,6 +1643,7 @@ class LogicalKeyboardKey extends Diagnosticable { 0x01000c0289: mailReply, 0x01000c028b: mailForward, 0x01000c028c: mailSend, + 0x01000c029f: showAllWindows, }; } @@ -1822,12 +1834,6 @@ class PhysicalKeyboardKey extends Diagnosticable { /// See the function [RawKeyEvent.physicalKey] for more information. static const PhysicalKeyboardKey turbo = PhysicalKeyboardKey(0x00000016, debugName: kReleaseMode ? null : 'Turbo'); - /// Represents the location of the "Launch Assistant" key on a generalized - /// keyboard. - /// - /// See the function [RawKeyEvent.physicalKey] for more information. - static const PhysicalKeyboardKey launchAssistant = PhysicalKeyboardKey(0x00000017, debugName: kReleaseMode ? null : 'Launch Assistant'); - /// Represents the location of the "Sleep" key on a generalized keyboard. /// /// See the function [RawKeyEvent.physicalKey] for more information. @@ -1838,6 +1844,12 @@ class PhysicalKeyboardKey extends Diagnosticable { /// See the function [RawKeyEvent.physicalKey] for more information. static const PhysicalKeyboardKey wakeUp = PhysicalKeyboardKey(0x00010083, debugName: kReleaseMode ? null : 'Wake Up'); + /// Represents the location of the "Display Toggle Int Ext" key on a + /// generalized keyboard. + /// + /// See the function [RawKeyEvent.physicalKey] for more information. + static const PhysicalKeyboardKey displayToggleIntExt = PhysicalKeyboardKey(0x000100b5, debugName: kReleaseMode ? null : 'Display Toggle Int Ext'); + /// Represents the location of the "Usb Reserved" key on a generalized /// keyboard. /// @@ -2912,6 +2924,12 @@ class PhysicalKeyboardKey extends Diagnosticable { /// See the function [RawKeyEvent.physicalKey] for more information. static const PhysicalKeyboardKey launchScreenSaver = PhysicalKeyboardKey(0x000c01b1, debugName: kReleaseMode ? null : 'Launch Screen Saver'); + /// Represents the location of the "Launch Assistant" key on a generalized + /// keyboard. + /// + /// See the function [RawKeyEvent.physicalKey] for more information. + static const PhysicalKeyboardKey launchAssistant = PhysicalKeyboardKey(0x000c01cb, debugName: kReleaseMode ? null : 'Launch Assistant'); + /// Represents the location of the "Launch Audio Browser" key on a generalized /// keyboard. /// @@ -3017,6 +3035,12 @@ class PhysicalKeyboardKey extends Diagnosticable { /// See the function [RawKeyEvent.physicalKey] for more information. static const PhysicalKeyboardKey mailSend = PhysicalKeyboardKey(0x000c028c, debugName: kReleaseMode ? null : 'Mail Send'); + /// Represents the location of the "Show All Windows" key on a generalized + /// keyboard. + /// + /// See the function [RawKeyEvent.physicalKey] for more information. + static const PhysicalKeyboardKey showAllWindows = PhysicalKeyboardKey(0x000c029f, debugName: kReleaseMode ? null : 'Show All Windows'); + // A list of all the predefined constant PhysicalKeyboardKeys so that they // can be searched. static const Map _knownPhysicalKeys = { @@ -3028,9 +3052,9 @@ class PhysicalKeyboardKey extends Diagnosticable { 0x00000014: suspend, 0x00000015: resume, 0x00000016: turbo, - 0x00000017: launchAssistant, 0x00010082: sleep, 0x00010083: wakeUp, + 0x000100b5: displayToggleIntExt, 0x00070000: usbReserved, 0x00070001: usbErrorRollOver, 0x00070002: usbPostFail, @@ -3232,6 +3256,7 @@ class PhysicalKeyboardKey extends Diagnosticable { 0x000c01ab: spellCheck, 0x000c01ae: launchKeyboardLayout, 0x000c01b1: launchScreenSaver, + 0x000c01cb: launchAssistant, 0x000c01b7: launchAudioBrowser, 0x000c0201: newKey, 0x000c0203: close, @@ -3251,5 +3276,6 @@ class PhysicalKeyboardKey extends Diagnosticable { 0x000c0289: mailReply, 0x000c028b: mailForward, 0x000c028c: mailSend, + 0x000c029f: showAllWindows, }; } diff --git a/packages/flutter/lib/src/services/keyboard_maps.dart b/packages/flutter/lib/src/services/keyboard_maps.dart index 4dfb557d88..21f0be593e 100644 --- a/packages/flutter/lib/src/services/keyboard_maps.dart +++ b/packages/flutter/lib/src/services/keyboard_maps.dart @@ -15,7 +15,6 @@ import 'keyboard_key.dart'; const Map kAndroidToLogicalKey = { 0: LogicalKeyboardKey.none, 119: LogicalKeyboardKey.fn, - 219: LogicalKeyboardKey.launchAssistant, 223: LogicalKeyboardKey.sleep, 224: LogicalKeyboardKey.wakeUp, 29: LogicalKeyboardKey.keyA, @@ -155,6 +154,7 @@ const Map kAndroidToLogicalKey = kFuchsiaToLogicalKey = kFuchsiaToLogicalKey = kFuchsiaToLogicalKey = kFuchsiaToPhysicalKey = kFuchsiaToPhysicalKey = kFuchsiaToPhysicalKey = kMacOsToPhysicalKey = { 0x00000000: PhysicalKeyboardKey.keyA, 0x0000000b: PhysicalKeyboardKey.keyB, @@ -1127,9 +1133,9 @@ const Map kGlfwNumpadMap = { /// Maps XKB specific key code values representing [PhysicalKeyboardKey]. const Map kLinuxToPhysicalKey = { - 0x0000024f: PhysicalKeyboardKey.launchAssistant, 0x00000096: PhysicalKeyboardKey.sleep, 0x00000097: PhysicalKeyboardKey.wakeUp, + 0x000000eb: PhysicalKeyboardKey.displayToggleIntExt, 0x00000026: PhysicalKeyboardKey.keyA, 0x00000038: PhysicalKeyboardKey.keyB, 0x00000036: PhysicalKeyboardKey.keyC, @@ -1317,6 +1323,7 @@ const Map kLinuxToPhysicalKey = kLinuxToPhysicalKey =