5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-06 23:00:36 +08:00
wails/v3/pkg/application/keys_linux.go

439 lines
7.8 KiB
Go

//go:build linux
package application
// Change Codes
// Reference: https://manpages.ubuntu.com/manpages/focal/man7/virkeycode-linux.7.html
var VirtualKeyCodes = map[uint]string{
0x2a: "lshift",
0x36: "rshift",
0x61: "rcontrol",
0x1d: "lcontrol",
0x38: "lalt",
0x64: "ralt",
0x7d: "lmeta",
0x7e: "rmeta",
0xb3: "lparen",
0xb4: "rparen",
0x1: "escape",
0xc: "minus",
0xd: "equal",
0xe: "back", // Backspace
0xf: "tab",
0x1a: "lbrace",
0x1b: "rbrace",
0x1c: "enter",
0x27: "semi",
0x28: "apostrophe",
0x29: "grave",
0x2b: "backslash",
0x33: "comma",
0x34: "dot",
0x35: "slash",
0x37: "asterisk",
0x39: "space",
0x3a: "caps",
0x66: "home",
0x68: "page_up",
0x67: "up",
0x6c: "down",
0x69: "left",
0x6a: "right",
0x6b: "end",
0x6d: "page_down",
0x6e: "insert",
0x6f: "delete",
0x98: "screen_lock",
0xb6: "redo",
0x83: "undo",
0x85: "copy",
0x87: "paste",
0x89: "cut",
0x9e: "back",
0x9f: "forward",
0xad: "refesh",
0xae: "exit",
0xaf: "move",
0xb0: "edit",
0xb1: "scroll_up",
0xb2: "scroll_down",
// Media Keys
0x71: "volume_mute",
0x72: "volume_down",
0x73: "volume_up",
0xa3: "media_next_track",
0xa4: "media_play_pause",
0xa5: "media_prev_track",
// Base Numbers
0xb: "0",
0x2: "1",
0x3: "2",
0x4: "3",
0x5: "4",
0x6: "5",
0x7: "6",
0x8: "7",
0x9: "8",
0xa: "9",
// Alphabet in QWERTY order
0x10: "q",
0x11: "w",
0x12: "e",
0x13: "r",
0x14: "t",
0x15: "y",
0x16: "u",
0x17: "i",
0x18: "o",
0x19: "p",
0x1e: "a",
0x1f: "s",
0x20: "d",
0x21: "f",
0x22: "g",
0x23: "h",
0x24: "j",
0x25: "k",
0x26: "l",
0x2c: "z",
0x2d: "x",
0x2e: "c",
0x2f: "v",
0x30: "b",
0x31: "n",
0x32: "m",
0x3b: "f1",
0x3c: "f2",
0x3d: "f3",
0x3e: "f4",
0x3f: "f5",
0x40: "f6",
0x41: "f7",
0x42: "f8",
0x43: "f9",
0x44: "f10",
0x57: "f11",
0x58: "f12",
0xb7: "f13",
0xb8: "f14",
0xb9: "f15",
0xba: "f16",
0xbb: "f17",
0xbc: "f18",
0xbd: "f19",
0xbe: "f20",
0xbf: "f21",
0xc0: "f22",
0xc1: "f23",
0xc2: "f24",
// Num Pad
0x45: "numlock",
0x46: "scrolllock",
0x4a: "subtract",
0x4e: "add",
0x53: "decimal",
0x60: "numpad_enter",
0x75: "numpad_equal",
0x76: "numpad_plus_minus",
0x79: "numpad_comma",
0x62: "divide",
0x52: "numpad0",
0x4f: "numpad1",
0x50: "numpad2",
0x51: "numpad3",
0x4b: "numpad4",
0x4c: "numpad5",
0x4d: "numpad6",
0x47: "numpad7",
0x48: "numpad8",
0x49: "numpad9",
// Language specific keys
0x55: "zenkakuhankaku",
0x56: "102nd", // some non-US keyboards have a key for less/greater than and pipe which lives on KEY_102ND
0x59: "ro", // No idea what this is so keeping it for now
0x5a: "katakana",
0x5b: "hiragana",
0x5c: "henkan",
0x5d: "katakanhiragana",
0x5f: "numpad_jp_comma",
0x5e: "muhenkan",
0x7a: "hangeul",
0x7b: "hanja",
0x7c: "yen",
// Linux
0x63: "sysrq", // Magic keypress
0x65: "line_feed",
0x70: "macro",
0x74: "power",
0x77: "pause",
0x78: "scale",
0x7f: "compose",
0x80: "stop",
0x81: "again",
0x82: "props", // ?
0x84: "front",
0x86: "open",
0x88: "find",
0x8a: "help",
0x8b: "menu",
0x8c: "calc",
0x8d: "setup",
0x8e: "sleep",
0x8f: "wakeup",
0x90: "file",
0x91: "send_file",
0x92: "delete_file",
0x93: "xfer",
0x96: "www",
0x97: "ms_dos",
0x99: "direction",
0x9a: "cycle_windows",
0x9b: "mail",
0x9c: "bookmarks",
0x9d: "computer",
0xa7: "record",
0xa8: "media_rewind",
0xa9: "phone",
0xaa: "iso",
0xab: "config",
0xac: "homepage",
0xb5: "new",
0xc8: "play_cd",
0xc9: "pause_cd",
0xa0: "close_cd",
0xa1: "eject_cd",
0xa2: "eject_close_cd",
0xa6: "stop_cd",
0x94: "prog1",
0x95: "prog2",
0xca: "prog3",
0xcb: "prog4",
0xcc: "dashboard",
0xcd: "suspend",
0xce: "close",
0xcf: "play",
0xd0: "fast_foward",
0xd1: "bass_boost",
0xd2: "print",
0xd3: "hp",
0xd4: "camera",
0xd5: "sound",
0xd6: "question",
0xd7: "email",
0xd8: "chat",
0xd9: "search",
0xda: "connect",
0xdb: "finance",
0xdc: "sport",
0xdd: "shop",
0xde: "alt_erase", // ?
0xdf: "cancel",
0xe0: "brightness_down",
0xe1: "brightnesst_up",
0xe2: "media",
0xe3: "switch_video_mode",
0xe4: "kb_backlight_toggle",
0xe5: "kb_backlight_down",
0xe6: "kb_backlight_up",
0xe7: "send",
0xe8: "reply",
0xe9: "forward_mail",
0xea: "save",
0xeb: "documents",
0xec: "battery",
0xed: "bluetooth",
0xee: "wlan",
0xef: "uwb", //?
0xf0: "unknown",
0xf1: "video_next",
0xf2: "video_prev",
0xf3: "brightness_cycle",
0xf4: "brightness_zero",
0xf5: "display_off",
0xf6: "wimax",
// Game pad?
// TODO: Match mappings with keys_windows.go strings where possible
0x100: "btn_0",
0x101: "btn_1",
0x102: "btn_2",
0x103: "btn_3",
0x104: "btn_4",
0x105: "btn_5",
0x106: "btn_6",
0x107: "btn_7",
0x108: "btn_8",
0x109: "btn_9",
0x110: "btn_left",
0x111: "btn_right",
0x112: "btn_middle",
0x113: "btn_side",
0x114: "btn_extra",
0x115: "btn_forward",
0x116: "btn_back",
0x117: "btn_task",
0x120: "btn_trigger",
0x121: "btn_thumb",
0x122: "btn_thumb2",
0x123: "btn_top",
0x124: "btn_top2",
0x125: "btn_pinkie",
0x126: "btn_base",
0x127: "btn_base2",
0x128: "btn_base3",
0x129: "btn_base4",
0x12a: "btn_base5",
0x12b: "btn_base6",
0x12f: "btn_dead",
0x130: "btn_a",
0x131: "btn_b",
0x132: "btn_c",
0x133: "btn_x",
0x134: "btn_y",
0x135: "btn_z",
0x136: "btn_tl",
0x137: "btn_tr",
0x138: "btn_tl2",
0x139: "btn_tr2",
0x13a: "btn_select",
0x13b: "btn_start",
0x13c: "btn_mode",
0x13d: "btn_thumbl",
0x13e: "btn_thumbr",
0x140: "btn_tool_pen",
0x141: "btn_tool_rubber",
0x142: "btn_tool_brush",
0x143: "btn_tool_pencil",
0x144: "btn_tool_airbrush",
0x145: "btn_tool_finger",
0x146: "btn_tool_mouse",
0x147: "btn_tool_lens",
0x14a: "btn_touch",
0x14b: "btn_stylus",
0x14c: "btn_stylus2",
0x14d: "btn_tool_doubletap",
0x14e: "btn_tool_tripletap",
0x14f: "btn_tool_quadtap",
0x150: "btn_gear_down",
0x151: "btn_gear_up",
0x160: "ok",
0x161: "select",
0x162: "goto",
0x163: "clear",
0x164: "power2",
0x165: "option",
0x166: "info",
0x167: "time",
0x168: "vendor",
0x169: "archive",
0x16a: "program",
0x16b: "channel",
0x16c: "favorites",
0x16d: "epg",
0x16e: "pvr",
0x16f: "mhp",
0x170: "language",
0x171: "title",
0x172: "subtitle",
0x173: "angle",
0x174: "zoom",
0x175: "mode",
0x176: "keyboard",
0x177: "screen",
0x178: "pc",
0x179: "tv",
0x17a: "tv2",
0x17b: "vcr",
0x17c: "vcr2",
0x17d: "sat",
0x17e: "sat2",
0x17f: "cd",
0x180: "tape",
0x181: "radio",
0x182: "tuner",
0x183: "player",
0x184: "text",
0x185: "dvd",
0x186: "aux",
0x187: "mp3",
0x188: "audio",
0x189: "video",
0x18a: "directory",
0x18b: "list",
0x18c: "memo",
0x18d: "calendar",
0x18e: "red",
0x18f: "green",
0x190: "yellow",
0x191: "blue",
0x192: "channel_up",
0x193: "channel_down",
0x194: "first",
0x195: "last",
0x196: "ab",
0x197: "next",
0x198: "restart",
0x199: "slow",
0x19a: "shuffle",
0x19b: "break",
0x19c: "previous",
0x19d: "digits",
0x19e: "teen",
0x19f: "twen",
0x1a0: "video_phone",
0x1a1: "games",
0x1a2: "zoomin",
0x1a3: "zoomout",
0x1a4: "zoomreset",
0x1a5: "word_processor",
0x1a6: "editor",
0x1a7: "spreadsheet",
0x1a8: "graphics_editor",
0x1a9: "presentation",
0x1aa: "database",
0x1ab: "news",
0x1ac: "voicemail",
0x1ad: "addressbook",
0x1ae: "messenger",
0x1af: "displaytoggle",
0x1b0: "spellcheck",
0x1b1: "logoff",
0x1b2: "dollar",
0x1b3: "euro",
0x1b4: "frameback",
0x1b5: "frameforward",
0x1b6: "ctx_menu",
0x1b7: "media_repeat",
0x1c0: "del_eol",
0x1c1: "del_eos",
0x1c2: "ins_line",
0x1c3: "del_line",
0x1d0: "fn",
0x1d1: "fn_esc",
0x1d2: "fn_f1",
0x1d3: "fn_f2",
0x1d4: "fn_f3",
0x1d5: "fn_f4",
0x1d6: "fn_f5",
0x1d7: "fn_f6",
0x1d8: "fn_f7",
0x1d9: "fn_f8",
0x1da: "fn_f9",
0x1db: "fn_f10",
0x1dc: "fn_f11",
0x1dd: "fn_f12",
0x200: "numpad0",
0x201: "numpad1",
0x202: "numpad2",
0x203: "numpad3",
0x204: "numpad4",
0x205: "numpad5",
0x206: "numpad6",
0x207: "numpad7",
0x208: "numpad8",
0x209: "numpad9",
0x20a: "star",
0x20b: "pound",
0x20c: "RFKill",
}