consts.dart 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_hbb/common.dart';
  3. import 'package:flutter_hbb/models/state_model.dart';
  4. import 'package:get/get.dart';
  5. const int kMaxVirtualDisplayCount = 4;
  6. const int kAllVirtualDisplay = -1;
  7. const double kDesktopRemoteTabBarHeight = 28.0;
  8. const int kInvalidWindowId = -1;
  9. const int kMainWindowId = 0;
  10. const kAllDisplayValue = -1;
  11. const kKeyLegacyMode = 'legacy';
  12. const kKeyMapMode = 'map';
  13. const kKeyTranslateMode = 'translate';
  14. const String kPlatformAdditionsIsWayland = "is_wayland";
  15. const String kPlatformAdditionsHeadless = "headless";
  16. const String kPlatformAdditionsIsInstalled = "is_installed";
  17. const String kPlatformAdditionsIddImpl = "idd_impl";
  18. const String kPlatformAdditionsRustDeskVirtualDisplays =
  19. "rustdesk_virtual_displays";
  20. const String kPlatformAdditionsAmyuniVirtualDisplays =
  21. "amyuni_virtual_displays";
  22. const String kPlatformAdditionsHasFileClipboard = "has_file_clipboard";
  23. const String kPlatformAdditionsSupportedPrivacyModeImpl =
  24. "supported_privacy_mode_impl";
  25. const String kPeerPlatformWindows = "Windows";
  26. const String kPeerPlatformLinux = "Linux";
  27. const String kPeerPlatformMacOS = "Mac OS";
  28. const String kPeerPlatformAndroid = "Android";
  29. const String kPeerPlatformWebDesktop = "WebDesktop";
  30. const double kScrollbarThickness = 12.0;
  31. /// [kAppTypeMain] used by 'Desktop Main Page' , 'Mobile (Client and Server)', "Install Page"
  32. const String kAppTypeMain = "main";
  33. /// [kAppTypeConnectionManager] only for 'Desktop CM Page'
  34. const String kAppTypeConnectionManager = "cm";
  35. const String kAppTypeDesktopRemote = "remote";
  36. const String kAppTypeDesktopFileTransfer = "file transfer";
  37. const String kAppTypeDesktopPortForward = "port forward";
  38. const String kWindowMainWindowOnTop = "main_window_on_top";
  39. const String kWindowGetWindowInfo = "get_window_info";
  40. const String kWindowGetScreenList = "get_screen_list";
  41. // This method is not used, maybe it can be removed.
  42. const String kWindowDisableGrabKeyboard = "disable_grab_keyboard";
  43. const String kWindowActionRebuild = "rebuild";
  44. const String kWindowEventHide = "hide";
  45. const String kWindowEventShow = "show";
  46. const String kWindowConnect = "connect";
  47. const String kWindowEventNewRemoteDesktop = "new_remote_desktop";
  48. const String kWindowEventNewFileTransfer = "new_file_transfer";
  49. const String kWindowEventNewPortForward = "new_port_forward";
  50. const String kWindowEventActiveSession = "active_session";
  51. const String kWindowEventActiveDisplaySession = "active_display_session";
  52. const String kWindowEventGetRemoteList = "get_remote_list";
  53. const String kWindowEventGetSessionIdList = "get_session_id_list";
  54. const String kWindowEventRemoteWindowCoords = "remote_window_coords";
  55. const String kWindowEventSetFullscreen = "set_fullscreen";
  56. const String kWindowEventMoveTabToNewWindow = "move_tab_to_new_window";
  57. const String kWindowEventGetCachedSessionData = "get_cached_session_data";
  58. const String kWindowEventOpenMonitorSession = "open_monitor_session";
  59. const String kOptionViewStyle = "view_style";
  60. const String kOptionScrollStyle = "scroll_style";
  61. const String kOptionImageQuality = "image_quality";
  62. const String kOptionOpenNewConnInTabs = "enable-open-new-connections-in-tabs";
  63. const String kOptionTextureRender = "use-texture-render";
  64. const String kOptionOpenInTabs = "allow-open-in-tabs";
  65. const String kOptionOpenInWindows = "allow-open-in-windows";
  66. const String kOptionForceAlwaysRelay = "force-always-relay";
  67. const String kOptionViewOnly = "view_only";
  68. const String kOptionEnableLanDiscovery = "enable-lan-discovery";
  69. const String kOptionWhitelist = "whitelist";
  70. const String kOptionEnableAbr = "enable-abr";
  71. const String kOptionEnableRecordSession = "enable-record-session";
  72. const String kOptionDirectServer = "direct-server";
  73. const String kOptionDirectAccessPort = "direct-access-port";
  74. const String kOptionAllowAutoDisconnect = "allow-auto-disconnect";
  75. const String kOptionAutoDisconnectTimeout = "auto-disconnect-timeout";
  76. const String kOptionEnableHwcodec = "enable-hwcodec";
  77. const String kOptionAllowAutoRecordIncoming = "allow-auto-record-incoming";
  78. const String kOptionAllowAutoRecordOutgoing = "allow-auto-record-outgoing";
  79. const String kOptionVideoSaveDirectory = "video-save-directory";
  80. const String kOptionAccessMode = "access-mode";
  81. const String kOptionEnableKeyboard = "enable-keyboard";
  82. // "Settings -> Security -> Permissions"
  83. const String kOptionEnableClipboard = "enable-clipboard";
  84. const String kOptionEnableFileTransfer = "enable-file-transfer";
  85. const String kOptionEnableAudio = "enable-audio";
  86. const String kOptionEnableTunnel = "enable-tunnel";
  87. const String kOptionEnableRemoteRestart = "enable-remote-restart";
  88. const String kOptionEnableBlockInput = "enable-block-input";
  89. const String kOptionAllowRemoteConfigModification =
  90. "allow-remote-config-modification";
  91. const String kOptionVerificationMethod = "verification-method";
  92. const String kOptionApproveMode = "approve-mode";
  93. const String kOptionCollapseToolbar = "collapse_toolbar";
  94. const String kOptionShowRemoteCursor = "show_remote_cursor";
  95. const String kOptionFollowRemoteCursor = "follow_remote_cursor";
  96. const String kOptionFollowRemoteWindow = "follow_remote_window";
  97. const String kOptionZoomCursor = "zoom-cursor";
  98. const String kOptionShowQualityMonitor = "show_quality_monitor";
  99. const String kOptionDisableAudio = "disable_audio";
  100. const String kOptionEnableFileCopyPaste = "enable-file-copy-paste";
  101. // "Settings -> Display -> Other default options"
  102. const String kOptionDisableClipboard = "disable_clipboard";
  103. const String kOptionLockAfterSessionEnd = "lock_after_session_end";
  104. const String kOptionPrivacyMode = "privacy_mode";
  105. const String kOptionTouchMode = "touch-mode";
  106. const String kOptionI444 = "i444";
  107. const String kOptionSwapLeftRightMouse = "swap-left-right-mouse";
  108. const String kOptionCodecPreference = "codec-preference";
  109. const String kOptionRemoteMenubarDragLeft = "remote-menubar-drag-left";
  110. const String kOptionRemoteMenubarDragRight = "remote-menubar-drag-right";
  111. const String kOptionHideAbTagsPanel = "hideAbTagsPanel";
  112. const String kOptionRemoteMenubarState = "remoteMenubarState";
  113. const String kOptionPeerSorting = "peer-sorting";
  114. const String kOptionPeerTabIndex = "peer-tab-index";
  115. const String kOptionPeerTabOrder = "peer-tab-order";
  116. const String kOptionPeerTabVisible = "peer-tab-visible";
  117. const String kOptionPeerCardUiType = "peer-card-ui-type";
  118. const String kOptionCurrentAbName = "current-ab-name";
  119. const String kOptionEnableConfirmClosingTabs = "enable-confirm-closing-tabs";
  120. const String kOptionAllowAlwaysSoftwareRender = "allow-always-software-render";
  121. const String kOptionEnableCheckUpdate = "enable-check-update";
  122. const String kOptionAllowLinuxHeadless = "allow-linux-headless";
  123. const String kOptionAllowRemoveWallpaper = "allow-remove-wallpaper";
  124. const String kOptionStopService = "stop-service";
  125. const String kOptionDirectxCapture = "enable-directx-capture";
  126. const String kOptionAllowRemoteCmModification = "allow-remote-cm-modification";
  127. const String kOptionEnableTrustedDevices = "enable-trusted-devices";
  128. // buildin opitons
  129. const String kOptionHideServerSetting = "hide-server-settings";
  130. const String kOptionHideProxySetting = "hide-proxy-settings";
  131. const String kOptionHideSecuritySetting = "hide-security-settings";
  132. const String kOptionHideNetworkSetting = "hide-network-settings";
  133. const String kOptionRemovePresetPasswordWarning =
  134. "remove-preset-password-warning";
  135. const kHideUsernameOnCard = "hide-username-on-card";
  136. const String kOptionHideHelpCards = "hide-help-cards";
  137. const String kOptionToggleViewOnly = "view-only";
  138. const String kOptionDisableFloatingWindow = "disable-floating-window";
  139. const String kOptionKeepScreenOn = "keep-screen-on";
  140. const String kOptionShowMobileAction = "showMobileActions";
  141. const String kUrlActionClose = "close";
  142. const String kTabLabelHomePage = "Home";
  143. const String kTabLabelSettingPage = "Settings";
  144. const String kWindowPrefix = "wm_";
  145. const int kWindowMainId = 0;
  146. const String kPointerEventKindTouch = "touch";
  147. const String kPointerEventKindMouse = "mouse";
  148. const String kMouseEventTypeDefault = "";
  149. const String kMouseEventTypePanStart = "pan_start";
  150. const String kMouseEventTypePanUpdate = "pan_update";
  151. const String kMouseEventTypePanEnd = "pan_end";
  152. const String kMouseEventTypeDown = "down";
  153. const String kMouseEventTypeUp = "up";
  154. const String kKeyFlutterKey = "flutter_key";
  155. const String kKeyShowDisplaysAsIndividualWindows =
  156. 'displays_as_individual_windows';
  157. const String kKeyUseAllMyDisplaysForTheRemoteSession =
  158. 'use_all_my_displays_for_the_remote_session';
  159. const String kKeyShowMonitorsToolbar = 'show_monitors_toolbar';
  160. const String kKeyReverseMouseWheel = "reverse_mouse_wheel";
  161. const String kMsgboxTextWaitingForImage = 'Connected, waiting for image...';
  162. // the executable name of the portable version
  163. const String kEnvPortableExecutable = "RUSTDESK_APPNAME";
  164. const Color kColorWarn = Color.fromARGB(255, 245, 133, 59);
  165. const Color kColorCanvas = Colors.black;
  166. const int kMobileDefaultDisplayWidth = 720;
  167. const int kMobileDefaultDisplayHeight = 1280;
  168. const int kDesktopDefaultDisplayWidth = 1080;
  169. const int kDesktopDefaultDisplayHeight = 720;
  170. const int kMobileMaxDisplaySize = 1280;
  171. const int kDesktopMaxDisplaySize = 3840;
  172. const double kDesktopFileTransferRowHeight = 30.0;
  173. const double kDesktopFileTransferHeaderHeight = 25.0;
  174. const double kMinFps = 5;
  175. const double kDefaultFps = 30;
  176. const double kMaxFps = 120;
  177. const double kMinQuality = 10;
  178. const double kDefaultQuality = 50;
  179. const double kMaxQuality = 100;
  180. const double kMaxMoreQuality = 2000;
  181. double kNewWindowOffset = isWindows
  182. ? 56.0
  183. : isLinux
  184. ? 50.0
  185. : isMacOS
  186. ? 30.0
  187. : 50.0;
  188. EdgeInsets get kDragToResizeAreaPadding => !kUseCompatibleUiMode && isLinux
  189. ? stateGlobal.fullscreen.isTrue || stateGlobal.isMaximized.value
  190. ? EdgeInsets.zero
  191. : EdgeInsets.all(5.0)
  192. : EdgeInsets.zero;
  193. // https://en.wikipedia.org/wiki/Non-breaking_space
  194. const int $nbsp = 0x00A0;
  195. extension StringExtension on String {
  196. String get nonBreaking => replaceAll(' ', String.fromCharCode($nbsp));
  197. }
  198. const Size kConnectionManagerWindowSizeClosedChat = Size(300, 490);
  199. const Size kConnectionManagerWindowSizeOpenChat = Size(700, 490);
  200. // Tabbar transition duration, now we remove the duration
  201. const Duration kTabTransitionDuration = Duration.zero;
  202. const double kEmptyMarginTop = 50;
  203. const double kDesktopIconButtonSplashRadius = 20;
  204. /// [kMinCursorSize] indicates min cursor (w, h)
  205. const int kMinCursorSize = 12;
  206. /// [kDefaultScrollAmountMultiplier] indicates how many rows can be scrolled after a minimum scroll action of mouse
  207. const kDefaultScrollAmountMultiplier = 5.0;
  208. const kDefaultScrollDuration = Duration(milliseconds: 50);
  209. const kDefaultMouseWheelThrottleDuration = Duration(milliseconds: 50);
  210. const kFullScreenEdgeSize = 0.0;
  211. const kMaximizeEdgeSize = 0.0;
  212. // Do not use kWindowResizeEdgeSize directly. Use `windowResizeEdgeSize` in `common.dart` instead.
  213. const kWindowResizeEdgeSize = 5.0;
  214. const kWindowBorderWidth = 1.0;
  215. const kDesktopMenuPadding = EdgeInsets.only(left: 12.0, right: 3.0);
  216. const kFrameBorderRadius = 12.0;
  217. const kFrameClipRRectBorderRadius = 12.0;
  218. const kFrameBoxShadowBlurRadius = 32.0;
  219. const kFrameBoxShadowOffsetFocused = 4.0;
  220. const kFrameBoxShadowOffsetUnfocused = 2.0;
  221. const kInvalidValueStr = 'InvalidValueStr';
  222. // Config key shared by flutter and other ui.
  223. const kCommConfKeyTheme = 'theme';
  224. const kCommConfKeyLang = 'lang';
  225. const kMobilePageConstraints = BoxConstraints(maxWidth: 600);
  226. /// [kMouseControlDistance] indicates the distance that self-side move to get control of mouse.
  227. const kMouseControlDistance = 12;
  228. /// [kMouseControlTimeoutMSec] indicates the timeout (in milliseconds) that self-side can get control of mouse.
  229. const kMouseControlTimeoutMSec = 1000;
  230. /// [kRemoteViewStyleOriginal] Show remote image without scaling.
  231. const kRemoteViewStyleOriginal = 'original';
  232. /// [kRemoteViewStyleAdaptive] Show remote image scaling by ratio factor.
  233. const kRemoteViewStyleAdaptive = 'adaptive';
  234. /// [kRemoteScrollStyleAuto] Scroll image auto by position.
  235. const kRemoteScrollStyleAuto = 'scrollauto';
  236. /// [kRemoteScrollStyleBar] Scroll image with scroll bar.
  237. const kRemoteScrollStyleBar = 'scrollbar';
  238. /// [kScrollModeDefault] Mouse or touchpad, the default scroll mode.
  239. const kScrollModeDefault = 'default';
  240. /// [kScrollModeReverse] Mouse or touchpad, the reverse scroll mode.
  241. const kScrollModeReverse = 'reverse';
  242. /// [kRemoteImageQualityBest] Best image quality.
  243. const kRemoteImageQualityBest = 'best';
  244. /// [kRemoteImageQualityBalanced] Balanced image quality, mid performance.
  245. const kRemoteImageQualityBalanced = 'balanced';
  246. /// [kRemoteImageQualityLow] Low image quality, better performance.
  247. const kRemoteImageQualityLow = 'low';
  248. /// [kRemoteImageQualityCustom] Custom image quality.
  249. const kRemoteImageQualityCustom = 'custom';
  250. const kIgnoreDpi = true;
  251. // ================================ mobile ================================
  252. // Magic numbers, maybe need to avoid it or use a better way to get them.
  253. const kMobileDelaySoftKeyboard = Duration(milliseconds: 30);
  254. const kMobileDelaySoftKeyboardFocus = Duration(milliseconds: 30);
  255. /// Android constants
  256. const kActionApplicationDetailsSettings =
  257. "android.settings.APPLICATION_DETAILS_SETTINGS";
  258. const kActionAccessibilitySettings = "android.settings.ACCESSIBILITY_SETTINGS";
  259. const kRecordAudio = "android.permission.RECORD_AUDIO";
  260. const kManageExternalStorage = "android.permission.MANAGE_EXTERNAL_STORAGE";
  261. const kRequestIgnoreBatteryOptimizations =
  262. "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
  263. const kSystemAlertWindow = "android.permission.SYSTEM_ALERT_WINDOW";
  264. const kAndroid13Notification = "android.permission.POST_NOTIFICATIONS";
  265. /// Android channel invoke type key
  266. class AndroidChannel {
  267. static final kStartAction = "start_action";
  268. static final kGetStartOnBootOpt = "get_start_on_boot_opt";
  269. static final kSetStartOnBootOpt = "set_start_on_boot_opt";
  270. static final kSyncAppDirConfigPath = "sync_app_dir";
  271. }
  272. /// flutter/packages/flutter/lib/src/services/keyboard_key.dart -> _keyLabels
  273. /// see [LogicalKeyboardKey.keyLabel]
  274. const Map<int, String> logicalKeyMap = <int, String>{
  275. 0x00000000020: 'VK_SPACE',
  276. 0x00000000022: 'VK_QUOTE',
  277. 0x0000000002c: 'VK_COMMA',
  278. 0x0000000002d: 'VK_MINUS',
  279. 0x0000000002f: 'VK_SLASH',
  280. 0x00000000030: 'VK_0',
  281. 0x00000000031: 'VK_1',
  282. 0x00000000032: 'VK_2',
  283. 0x00000000033: 'VK_3',
  284. 0x00000000034: 'VK_4',
  285. 0x00000000035: 'VK_5',
  286. 0x00000000036: 'VK_6',
  287. 0x00000000037: 'VK_7',
  288. 0x00000000038: 'VK_8',
  289. 0x00000000039: 'VK_9',
  290. 0x0000000003b: 'VK_SEMICOLON',
  291. 0x0000000003d: 'VK_PLUS', // it is =
  292. 0x0000000005b: 'VK_LBRACKET',
  293. 0x0000000005c: 'VK_BACKSLASH',
  294. 0x0000000005d: 'VK_RBRACKET',
  295. 0x00000000061: 'VK_A',
  296. 0x00000000062: 'VK_B',
  297. 0x00000000063: 'VK_C',
  298. 0x00000000064: 'VK_D',
  299. 0x00000000065: 'VK_E',
  300. 0x00000000066: 'VK_F',
  301. 0x00000000067: 'VK_G',
  302. 0x00000000068: 'VK_H',
  303. 0x00000000069: 'VK_I',
  304. 0x0000000006a: 'VK_J',
  305. 0x0000000006b: 'VK_K',
  306. 0x0000000006c: 'VK_L',
  307. 0x0000000006d: 'VK_M',
  308. 0x0000000006e: 'VK_N',
  309. 0x0000000006f: 'VK_O',
  310. 0x00000000070: 'VK_P',
  311. 0x00000000071: 'VK_Q',
  312. 0x00000000072: 'VK_R',
  313. 0x00000000073: 'VK_S',
  314. 0x00000000074: 'VK_T',
  315. 0x00000000075: 'VK_U',
  316. 0x00000000076: 'VK_V',
  317. 0x00000000077: 'VK_W',
  318. 0x00000000078: 'VK_X',
  319. 0x00000000079: 'VK_Y',
  320. 0x0000000007a: 'VK_Z',
  321. 0x00100000008: 'VK_BACK',
  322. 0x00100000009: 'VK_TAB',
  323. 0x0010000000d: 'VK_ENTER',
  324. 0x0010000001b: 'VK_ESCAPE',
  325. 0x0010000007f: 'VK_DELETE',
  326. 0x00100000104: 'VK_CAPITAL',
  327. 0x00100000301: 'VK_DOWN',
  328. 0x00100000302: 'VK_LEFT',
  329. 0x00100000303: 'VK_RIGHT',
  330. 0x00100000304: 'VK_UP',
  331. 0x00100000305: 'VK_END',
  332. 0x00100000306: 'VK_HOME',
  333. 0x00100000307: 'VK_NEXT',
  334. 0x00100000308: 'VK_PRIOR',
  335. 0x00100000401: 'VK_CLEAR',
  336. 0x00100000407: 'VK_INSERT',
  337. 0x00100000504: 'VK_CANCEL',
  338. 0x00100000506: 'VK_EXECUTE',
  339. 0x00100000508: 'VK_HELP',
  340. 0x00100000509: 'VK_PAUSE',
  341. 0x0010000050c: 'VK_SELECT',
  342. 0x00100000608: 'VK_PRINT',
  343. 0x00100000705: 'VK_CONVERT',
  344. 0x00100000706: 'VK_FINAL',
  345. 0x00100000711: 'VK_HANGUL',
  346. 0x00100000712: 'VK_HANJA',
  347. 0x00100000713: 'VK_JUNJA',
  348. 0x00100000718: 'VK_KANA',
  349. 0x00100000719: 'VK_KANJI',
  350. 0x00100000801: 'VK_F1',
  351. 0x00100000802: 'VK_F2',
  352. 0x00100000803: 'VK_F3',
  353. 0x00100000804: 'VK_F4',
  354. 0x00100000805: 'VK_F5',
  355. 0x00100000806: 'VK_F6',
  356. 0x00100000807: 'VK_F7',
  357. 0x00100000808: 'VK_F8',
  358. 0x00100000809: 'VK_F9',
  359. 0x0010000080a: 'VK_F10',
  360. 0x0010000080b: 'VK_F11',
  361. 0x0010000080c: 'VK_F12',
  362. 0x00100000d2b: 'Apps',
  363. 0x00200000002: 'VK_SLEEP',
  364. 0x00200000100: 'VK_CONTROL',
  365. 0x00200000101: 'RControl',
  366. 0x00200000102: 'VK_SHIFT',
  367. 0x00200000103: 'RShift',
  368. 0x00200000104: 'VK_MENU',
  369. 0x00200000105: 'RAlt',
  370. 0x002000001f0: 'VK_CONTROL',
  371. 0x002000001f2: 'VK_SHIFT',
  372. 0x002000001f4: 'VK_MENU',
  373. 0x002000001f6: 'Meta',
  374. 0x0020000022a: 'VK_MULTIPLY',
  375. 0x0020000022b: 'VK_ADD',
  376. 0x0020000022d: 'VK_SUBTRACT',
  377. 0x0020000022e: 'VK_DECIMAL',
  378. 0x0020000022f: 'VK_DIVIDE',
  379. 0x00200000230: 'VK_NUMPAD0',
  380. 0x00200000231: 'VK_NUMPAD1',
  381. 0x00200000232: 'VK_NUMPAD2',
  382. 0x00200000233: 'VK_NUMPAD3',
  383. 0x00200000234: 'VK_NUMPAD4',
  384. 0x00200000235: 'VK_NUMPAD5',
  385. 0x00200000236: 'VK_NUMPAD6',
  386. 0x00200000237: 'VK_NUMPAD7',
  387. 0x00200000238: 'VK_NUMPAD8',
  388. 0x00200000239: 'VK_NUMPAD9',
  389. };
  390. /// flutter/packages/flutter/lib/src/services/keyboard_key.dart -> _debugName
  391. /// see [PhysicalKeyboardKey.debugName] -> _debugName
  392. const Map<int, String> physicalKeyMap = <int, String>{
  393. 0x00010082: 'VK_SLEEP',
  394. 0x00070004: 'VK_A',
  395. 0x00070005: 'VK_B',
  396. 0x00070006: 'VK_C',
  397. 0x00070007: 'VK_D',
  398. 0x00070008: 'VK_E',
  399. 0x00070009: 'VK_F',
  400. 0x0007000a: 'VK_G',
  401. 0x0007000b: 'VK_H',
  402. 0x0007000c: 'VK_I',
  403. 0x0007000d: 'VK_J',
  404. 0x0007000e: 'VK_K',
  405. 0x0007000f: 'VK_L',
  406. 0x00070010: 'VK_M',
  407. 0x00070011: 'VK_N',
  408. 0x00070012: 'VK_O',
  409. 0x00070013: 'VK_P',
  410. 0x00070014: 'VK_Q',
  411. 0x00070015: 'VK_R',
  412. 0x00070016: 'VK_S',
  413. 0x00070017: 'VK_T',
  414. 0x00070018: 'VK_U',
  415. 0x00070019: 'VK_V',
  416. 0x0007001a: 'VK_W',
  417. 0x0007001b: 'VK_X',
  418. 0x0007001c: 'VK_Y',
  419. 0x0007001d: 'VK_Z',
  420. 0x0007001e: 'VK_1',
  421. 0x0007001f: 'VK_2',
  422. 0x00070020: 'VK_3',
  423. 0x00070021: 'VK_4',
  424. 0x00070022: 'VK_5',
  425. 0x00070023: 'VK_6',
  426. 0x00070024: 'VK_7',
  427. 0x00070025: 'VK_8',
  428. 0x00070026: 'VK_9',
  429. 0x00070027: 'VK_0',
  430. 0x00070028: 'VK_ENTER',
  431. 0x00070029: 'VK_ESCAPE',
  432. 0x0007002a: 'VK_BACK',
  433. 0x0007002b: 'VK_TAB',
  434. 0x0007002c: 'VK_SPACE',
  435. 0x0007002d: 'VK_MINUS',
  436. 0x0007002e: 'VK_PLUS', // it is =
  437. 0x0007002f: 'VK_LBRACKET',
  438. 0x00070030: 'VK_RBRACKET',
  439. 0x00070033: 'VK_SEMICOLON',
  440. 0x00070034: 'VK_QUOTE',
  441. 0x00070036: 'VK_COMMA',
  442. 0x00070038: 'VK_SLASH',
  443. 0x00070039: 'VK_CAPITAL',
  444. 0x0007003a: 'VK_F1',
  445. 0x0007003b: 'VK_F2',
  446. 0x0007003c: 'VK_F3',
  447. 0x0007003d: 'VK_F4',
  448. 0x0007003e: 'VK_F5',
  449. 0x0007003f: 'VK_F6',
  450. 0x00070040: 'VK_F7',
  451. 0x00070041: 'VK_F8',
  452. 0x00070042: 'VK_F9',
  453. 0x00070043: 'VK_F10',
  454. 0x00070044: 'VK_F11',
  455. 0x00070045: 'VK_F12',
  456. 0x00070049: 'VK_INSERT',
  457. 0x0007004a: 'VK_HOME',
  458. 0x0007004b: 'VK_PRIOR', // Page Up
  459. 0x0007004c: 'VK_DELETE',
  460. 0x0007004d: 'VK_END',
  461. 0x0007004e: 'VK_NEXT', // Page Down
  462. 0x0007004f: 'VK_RIGHT',
  463. 0x00070050: 'VK_LEFT',
  464. 0x00070051: 'VK_DOWN',
  465. 0x00070052: 'VK_UP',
  466. 0x00070053: 'Num Lock', // TODO rust not impl
  467. 0x00070054: 'VK_DIVIDE', // numpad
  468. 0x00070055: 'VK_MULTIPLY',
  469. 0x00070056: 'VK_SUBTRACT',
  470. 0x00070057: 'VK_ADD',
  471. 0x00070058: 'VK_ENTER', // num enter
  472. 0x00070059: 'VK_NUMPAD1',
  473. 0x0007005a: 'VK_NUMPAD2',
  474. 0x0007005b: 'VK_NUMPAD3',
  475. 0x0007005c: 'VK_NUMPAD4',
  476. 0x0007005d: 'VK_NUMPAD5',
  477. 0x0007005e: 'VK_NUMPAD6',
  478. 0x0007005f: 'VK_NUMPAD7',
  479. 0x00070060: 'VK_NUMPAD8',
  480. 0x00070061: 'VK_NUMPAD9',
  481. 0x00070062: 'VK_NUMPAD0',
  482. 0x00070063: 'VK_DECIMAL',
  483. 0x00070075: 'VK_HELP',
  484. 0x00070077: 'VK_SELECT',
  485. 0x00070088: 'VK_KANA',
  486. 0x0007008a: 'VK_CONVERT',
  487. 0x000700e0: 'VK_CONTROL',
  488. 0x000700e1: 'VK_SHIFT',
  489. 0x000700e2: 'VK_MENU',
  490. 0x000700e3: 'Meta',
  491. 0x000700e4: 'RControl',
  492. 0x000700e5: 'RShift',
  493. 0x000700e6: 'RAlt',
  494. 0x000700e7: 'RWin',
  495. 0x000c00b1: 'VK_PAUSE',
  496. 0x000c00cd: 'VK_PAUSE',
  497. 0x000c019e: 'LOCK_SCREEN',
  498. 0x000c0208: 'VK_PRINT',
  499. };
  500. /// The windows targets in the publish time order.
  501. enum WindowsTarget {
  502. naw, // not a windows target
  503. xp,
  504. vista,
  505. w7,
  506. w8,
  507. w8_1,
  508. w10,
  509. w11
  510. }
  511. /// A convenient method to transform a build number to the corresponding windows version.
  512. extension WindowsTargetExt on int {
  513. WindowsTarget get windowsVersion => getWindowsTarget(this);
  514. }
  515. const kCheckSoftwareUpdateFinish = 'check_software_update_finish';