Support GTK keycodes (#59961)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
179
dev/tools/gen_keycodes/data/key_name_to_gtk_name.json
Normal file
179
dev/tools/gen_keycodes/data/key_name_to_gtk_name.json
Normal file
@@ -0,0 +1,179 @@
|
||||
{
|
||||
"altLeft": ["Alt_L"],
|
||||
"altRight": ["Alt_R"],
|
||||
"arrowDown": ["Down", "KP_Down"],
|
||||
"arrowLeft": ["Left", "KP_Left"],
|
||||
"arrowRight": ["Right", "KP_Right"],
|
||||
"arrowUp": ["Up", "KP_Up"],
|
||||
"audioVolumeDown": ["AudioLowerVolume"],
|
||||
"audioVolumeMute": ["AudioMute"],
|
||||
"audioVolumeUp": ["AudioRaiseVolume"],
|
||||
"backquote": ["quoteleft"],
|
||||
"backslash": ["backslash"],
|
||||
"backspace": ["BackSpace"],
|
||||
"bracketLeft": ["bracketleft"],
|
||||
"bracketRight": ["bracketright"],
|
||||
"brightnessDown": ["MonBrightnessDown"],
|
||||
"brightnessUp": ["MonBrightnessUp"],
|
||||
"browserBack": ["Back"],
|
||||
"browserFavorites": ["Favorites"],
|
||||
"browserFavourites": ["Favourites"],
|
||||
"browserForward": ["Forward"],
|
||||
"browserHome": ["HomePage"],
|
||||
"browserRefresh": ["Refresh"],
|
||||
"browserSearch": ["Search"],
|
||||
"browserStop": ["Stop"],
|
||||
"capsLock": ["Caps_Lock"],
|
||||
"close": ["Close"],
|
||||
"comma": ["comma"],
|
||||
"contextMenu": ["Menu"],
|
||||
"controlLeft": ["Control_L"],
|
||||
"controlRight": ["Control_R"],
|
||||
"copy": ["Copy", "3270_Copy"],
|
||||
"delete": ["Delete", "KP_Delete"],
|
||||
"digit0": ["0"],
|
||||
"digit1": ["1"],
|
||||
"digit2": ["2"],
|
||||
"digit3": ["3"],
|
||||
"digit4": ["4"],
|
||||
"digit5": ["5"],
|
||||
"digit6": ["6"],
|
||||
"digit7": ["7"],
|
||||
"digit8": ["8"],
|
||||
"digit9": ["9"],
|
||||
"eject": ["Eject"],
|
||||
"end": ["End", "KP_End"],
|
||||
"enter": ["Return", "Enter"],
|
||||
"equal": ["equal"],
|
||||
"escape": ["Escape"],
|
||||
"f1": ["F1", "KP_F1"],
|
||||
"f2": ["F2", "KP_F2"],
|
||||
"f3": ["F3", "KP_F3"],
|
||||
"f4": ["F4", "KP_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"],
|
||||
"f24": ["F24"],
|
||||
"f25": ["F25"],
|
||||
"find": ["Find"],
|
||||
"help": ["Help"],
|
||||
"home": ["Home", "KP_Home"],
|
||||
"hyper": ["Hyper_L", "Hyper_R"],
|
||||
"insert": ["Insert", "KP_Insert"],
|
||||
"intlYen": ["yen"],
|
||||
"kanaMode": ["kana_switch"],
|
||||
"kbdIllumDown": ["KbdBrightnessDown"],
|
||||
"kbdIllumUp": ["KbdBrightnessUp"],
|
||||
"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"],
|
||||
"launchAudioBrowser": ["Music"],
|
||||
"launchCalendar": ["Calendar"],
|
||||
"launchDocuments": ["Document"],
|
||||
"launchInternetBrowser": ["WWW"],
|
||||
"launchMail": ["Mail"],
|
||||
"launchPhone": ["Phone"],
|
||||
"launchScreenSaver": ["ScreenSaver"],
|
||||
"logOff": ["LogOff"],
|
||||
"mailForward": ["MailForward"],
|
||||
"mailReply": ["Reply"],
|
||||
"mailSend": ["Send"],
|
||||
"mediaFastForward": ["AudioForward"],
|
||||
"mediaPause": ["AudioPause"],
|
||||
"mediaPlay": ["AudioPlay", "3270_Play"],
|
||||
"mediaRecord": ["AudioRecord"],
|
||||
"mediaRewind": ["AudioRewind"],
|
||||
"mediaStop": ["AudioStop"],
|
||||
"mediaTrackNext": ["AudioNext"],
|
||||
"mediaTrackPrevious": ["AudioPrev"],
|
||||
"metaLeft": ["Meta_L"],
|
||||
"metaRight": ["Meta_R"],
|
||||
"minus": ["minus"],
|
||||
"newKey": ["New"],
|
||||
"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"],
|
||||
"numpadAdd": ["KP_Add"],
|
||||
"numpadDecimal": ["KP_Decimal"],
|
||||
"numpadDivide": ["KP_Divide"],
|
||||
"numpadEnter": ["KP_Enter"],
|
||||
"numpadEqual": ["KP_Equal"],
|
||||
"numpadMultiply": ["KP_Multiply"],
|
||||
"numpadSubtract": ["KP_Subtract"],
|
||||
"open": ["Open"],
|
||||
"pageDown": ["Page_Down", "KP_Page_Down"],
|
||||
"pageUp": ["Page_Up", "KP_Page_Up"],
|
||||
"paste": ["Paste"],
|
||||
"pause": ["Pause"],
|
||||
"period": ["period"],
|
||||
"power": ["PowerOff"],
|
||||
"print": ["Print"],
|
||||
"printScreen": ["3270_PrintScreen"],
|
||||
"quote": ["apostrophe"],
|
||||
"redo": ["Redo"],
|
||||
"resume": ["Resume"],
|
||||
"save": ["Save"],
|
||||
"scrollLock": ["Scroll_Lock"],
|
||||
"select": ["Select"],
|
||||
"semicolon": ["semicolon"],
|
||||
"shiftLeft": ["Shift_L"],
|
||||
"shiftRight": ["Shift_R"],
|
||||
"slash": ["slash"],
|
||||
"sleep": ["Sleep"],
|
||||
"space": ["space", "KP_Space"],
|
||||
"spellCheck": ["Spell"],
|
||||
"superKey": ["Super_L", "Super_R"],
|
||||
"suspend": ["Suspend"],
|
||||
"tab": ["Tab", "KP_Tab"],
|
||||
"undo": ["Undo"],
|
||||
"wakeUp": ["WakeUp"],
|
||||
"zoomIn": ["ZoomIn"],
|
||||
"zoomOut": ["ZoomOut"]
|
||||
}
|
||||
24
dev/tools/gen_keycodes/data/keyboard_map_gtk_cc.tmpl
Normal file
24
dev/tools/gen_keycodes/data/keyboard_map_gtk_cc.tmpl
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <map>
|
||||
|
||||
// DO NOT EDIT -- DO NOT EDIT -- DO NOT EDIT
|
||||
// This file is generated by flutter/flutter@dev/tools/gen_keycodes/bin/gen_keycodes.dart and
|
||||
// should not be edited directly.
|
||||
//
|
||||
// Edit the template dev/tools/gen_keycodes/data/keyboard_maps_gtk_cxx.tmpl instead.
|
||||
// See dev/tools/gen_keycodes/README.md for more information.
|
||||
|
||||
/// Maps GTK-specific key codes to the matching [LogicalKeyboardKey].
|
||||
const std::map<int, int> g_gtk_to_logical_key = {
|
||||
@@@GTK_KEY_CODE_MAP@@@
|
||||
};
|
||||
|
||||
/// A map of GTK 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 std::map<int, int> g_gtk_numpad_map = {
|
||||
@@@GTK_NUMPAD_MAP@@@
|
||||
};
|
||||
@@ -71,6 +71,18 @@ const Map<int, LogicalKeyboardKey> kGlfwNumpadMap = <int, LogicalKeyboardKey>{
|
||||
@@@GLFW_NUMPAD_MAP@@@
|
||||
};
|
||||
|
||||
/// Maps GTK-specific key codes to the matching [LogicalKeyboardKey].
|
||||
const Map<int, LogicalKeyboardKey> kGtkToLogicalKey = <int, LogicalKeyboardKey>{
|
||||
@@@GTK_KEY_CODE_MAP@@@
|
||||
};
|
||||
|
||||
/// A map of GTK 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> kGtkNumpadMap = <int, LogicalKeyboardKey>{
|
||||
@@@GTK_NUMPAD_MAP@@@
|
||||
};
|
||||
|
||||
/// Maps XKB specific key code values representing [PhysicalKeyboardKey].
|
||||
const Map<int, PhysicalKeyboardKey> kLinuxToPhysicalKey = <int, PhysicalKeyboardKey>{
|
||||
@@@XKB_SCAN_CODE_MAP@@@
|
||||
|
||||
Reference in New Issue
Block a user