consts.dart 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  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 kKeyFlutterKey = "flutter_key";
  149. const String kKeyShowDisplaysAsIndividualWindows =
  150. 'displays_as_individual_windows';
  151. const String kKeyUseAllMyDisplaysForTheRemoteSession =
  152. 'use_all_my_displays_for_the_remote_session';
  153. const String kKeyShowMonitorsToolbar = 'show_monitors_toolbar';
  154. const String kKeyReverseMouseWheel = "reverse_mouse_wheel";
  155. const String kMsgboxTextWaitingForImage = 'Connected, waiting for image...';
  156. // the executable name of the portable version
  157. const String kEnvPortableExecutable = "RUSTDESK_APPNAME";
  158. const Color kColorWarn = Color.fromARGB(255, 245, 133, 59);
  159. const Color kColorCanvas = Colors.black;
  160. const int kMobileDefaultDisplayWidth = 720;
  161. const int kMobileDefaultDisplayHeight = 1280;
  162. const int kDesktopDefaultDisplayWidth = 1080;
  163. const int kDesktopDefaultDisplayHeight = 720;
  164. const int kMobileMaxDisplaySize = 1280;
  165. const int kDesktopMaxDisplaySize = 3840;
  166. const double kDesktopFileTransferRowHeight = 30.0;
  167. const double kDesktopFileTransferHeaderHeight = 25.0;
  168. const double kMinFps = 5;
  169. const double kDefaultFps = 30;
  170. const double kMaxFps = 120;
  171. const double kMinQuality = 5;
  172. const double kDefaultQuality = 50;
  173. const double kMaxQuality = 100;
  174. const double kMaxMoreQuality = 2000;
  175. double kNewWindowOffset = isWindows
  176. ? 56.0
  177. : isLinux
  178. ? 50.0
  179. : isMacOS
  180. ? 30.0
  181. : 50.0;
  182. EdgeInsets get kDragToResizeAreaPadding => !kUseCompatibleUiMode && isLinux
  183. ? stateGlobal.fullscreen.isTrue || stateGlobal.isMaximized.value
  184. ? EdgeInsets.zero
  185. : EdgeInsets.all(5.0)
  186. : EdgeInsets.zero;
  187. // https://en.wikipedia.org/wiki/Non-breaking_space
  188. const int $nbsp = 0x00A0;
  189. extension StringExtension on String {
  190. String get nonBreaking => replaceAll(' ', String.fromCharCode($nbsp));
  191. }
  192. const Size kConnectionManagerWindowSizeClosedChat = Size(300, 490);
  193. const Size kConnectionManagerWindowSizeOpenChat = Size(700, 490);
  194. // Tabbar transition duration, now we remove the duration
  195. const Duration kTabTransitionDuration = Duration.zero;
  196. const double kEmptyMarginTop = 50;
  197. const double kDesktopIconButtonSplashRadius = 20;
  198. /// [kMinCursorSize] indicates min cursor (w, h)
  199. const int kMinCursorSize = 12;
  200. /// [kDefaultScrollAmountMultiplier] indicates how many rows can be scrolled after a minimum scroll action of mouse
  201. const kDefaultScrollAmountMultiplier = 5.0;
  202. const kDefaultScrollDuration = Duration(milliseconds: 50);
  203. const kDefaultMouseWheelThrottleDuration = Duration(milliseconds: 50);
  204. const kFullScreenEdgeSize = 0.0;
  205. const kMaximizeEdgeSize = 0.0;
  206. // Do not use kWindowResizeEdgeSize directly. Use `windowResizeEdgeSize` in `common.dart` instead.
  207. const kWindowResizeEdgeSize = 5.0;
  208. const kWindowBorderWidth = 1.0;
  209. const kDesktopMenuPadding = EdgeInsets.only(left: 12.0, right: 3.0);
  210. const kFrameBorderRadius = 12.0;
  211. const kFrameClipRRectBorderRadius = 12.0;
  212. const kFrameBoxShadowBlurRadius = 32.0;
  213. const kFrameBoxShadowOffsetFocused = 4.0;
  214. const kFrameBoxShadowOffsetUnfocused = 2.0;
  215. const kInvalidValueStr = 'InvalidValueStr';
  216. // Config key shared by flutter and other ui.
  217. const kCommConfKeyTheme = 'theme';
  218. const kCommConfKeyLang = 'lang';
  219. const kMobilePageConstraints = BoxConstraints(maxWidth: 600);
  220. /// [kMouseControlDistance] indicates the distance that self-side move to get control of mouse.
  221. const kMouseControlDistance = 12;
  222. /// [kMouseControlTimeoutMSec] indicates the timeout (in milliseconds) that self-side can get control of mouse.
  223. const kMouseControlTimeoutMSec = 1000;
  224. /// [kRemoteViewStyleOriginal] Show remote image without scaling.
  225. const kRemoteViewStyleOriginal = 'original';
  226. /// [kRemoteViewStyleAdaptive] Show remote image scaling by ratio factor.
  227. const kRemoteViewStyleAdaptive = 'adaptive';
  228. /// [kRemoteScrollStyleAuto] Scroll image auto by position.
  229. const kRemoteScrollStyleAuto = 'scrollauto';
  230. /// [kRemoteScrollStyleBar] Scroll image with scroll bar.
  231. const kRemoteScrollStyleBar = 'scrollbar';
  232. /// [kScrollModeDefault] Mouse or touchpad, the default scroll mode.
  233. const kScrollModeDefault = 'default';
  234. /// [kScrollModeReverse] Mouse or touchpad, the reverse scroll mode.
  235. const kScrollModeReverse = 'reverse';
  236. /// [kRemoteImageQualityBest] Best image quality.
  237. const kRemoteImageQualityBest = 'best';
  238. /// [kRemoteImageQualityBalanced] Balanced image quality, mid performance.
  239. const kRemoteImageQualityBalanced = 'balanced';
  240. /// [kRemoteImageQualityLow] Low image quality, better performance.
  241. const kRemoteImageQualityLow = 'low';
  242. /// [kRemoteImageQualityCustom] Custom image quality.
  243. const kRemoteImageQualityCustom = 'custom';
  244. const kIgnoreDpi = true;
  245. // ================================ mobile ================================
  246. // Magic numbers, maybe need to avoid it or use a better way to get them.
  247. const kMobileDelaySoftKeyboard = Duration(milliseconds: 30);
  248. const kMobileDelaySoftKeyboardFocus = Duration(milliseconds: 30);
  249. /// Android constants
  250. const kActionApplicationDetailsSettings =
  251. "android.settings.APPLICATION_DETAILS_SETTINGS";
  252. const kActionAccessibilitySettings = "android.settings.ACCESSIBILITY_SETTINGS";
  253. const kRecordAudio = "android.permission.RECORD_AUDIO";
  254. const kManageExternalStorage = "android.permission.MANAGE_EXTERNAL_STORAGE";
  255. const kRequestIgnoreBatteryOptimizations =
  256. "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
  257. const kSystemAlertWindow = "android.permission.SYSTEM_ALERT_WINDOW";
  258. const kAndroid13Notification = "android.permission.POST_NOTIFICATIONS";
  259. /// Android channel invoke type key
  260. class AndroidChannel {
  261. static final kStartAction = "start_action";
  262. static final kGetStartOnBootOpt = "get_start_on_boot_opt";
  263. static final kSetStartOnBootOpt = "set_start_on_boot_opt";
  264. static final kSyncAppDirConfigPath = "sync_app_dir";
  265. }
  266. /// flutter/packages/flutter/lib/src/services/keyboard_key.dart -> _keyLabels
  267. /// see [LogicalKeyboardKey.keyLabel]
  268. const Map<int, String> logicalKeyMap = <int, String>{
  269. 0x00000000020: 'VK_SPACE',
  270. 0x00000000022: 'VK_QUOTE',
  271. 0x0000000002c: 'VK_COMMA',
  272. 0x0000000002d: 'VK_MINUS',
  273. 0x0000000002f: 'VK_SLASH',
  274. 0x00000000030: 'VK_0',
  275. 0x00000000031: 'VK_1',
  276. 0x00000000032: 'VK_2',
  277. 0x00000000033: 'VK_3',
  278. 0x00000000034: 'VK_4',
  279. 0x00000000035: 'VK_5',
  280. 0x00000000036: 'VK_6',
  281. 0x00000000037: 'VK_7',
  282. 0x00000000038: 'VK_8',
  283. 0x00000000039: 'VK_9',
  284. 0x0000000003b: 'VK_SEMICOLON',
  285. 0x0000000003d: 'VK_PLUS', // it is =
  286. 0x0000000005b: 'VK_LBRACKET',
  287. 0x0000000005c: 'VK_BACKSLASH',
  288. 0x0000000005d: 'VK_RBRACKET',
  289. 0x00000000061: 'VK_A',
  290. 0x00000000062: 'VK_B',
  291. 0x00000000063: 'VK_C',
  292. 0x00000000064: 'VK_D',
  293. 0x00000000065: 'VK_E',
  294. 0x00000000066: 'VK_F',
  295. 0x00000000067: 'VK_G',
  296. 0x00000000068: 'VK_H',
  297. 0x00000000069: 'VK_I',
  298. 0x0000000006a: 'VK_J',
  299. 0x0000000006b: 'VK_K',
  300. 0x0000000006c: 'VK_L',
  301. 0x0000000006d: 'VK_M',
  302. 0x0000000006e: 'VK_N',
  303. 0x0000000006f: 'VK_O',
  304. 0x00000000070: 'VK_P',
  305. 0x00000000071: 'VK_Q',
  306. 0x00000000072: 'VK_R',
  307. 0x00000000073: 'VK_S',
  308. 0x00000000074: 'VK_T',
  309. 0x00000000075: 'VK_U',
  310. 0x00000000076: 'VK_V',
  311. 0x00000000077: 'VK_W',
  312. 0x00000000078: 'VK_X',
  313. 0x00000000079: 'VK_Y',
  314. 0x0000000007a: 'VK_Z',
  315. 0x00100000008: 'VK_BACK',
  316. 0x00100000009: 'VK_TAB',
  317. 0x0010000000d: 'VK_ENTER',
  318. 0x0010000001b: 'VK_ESCAPE',
  319. 0x0010000007f: 'VK_DELETE',
  320. 0x00100000104: 'VK_CAPITAL',
  321. 0x00100000301: 'VK_DOWN',
  322. 0x00100000302: 'VK_LEFT',
  323. 0x00100000303: 'VK_RIGHT',
  324. 0x00100000304: 'VK_UP',
  325. 0x00100000305: 'VK_END',
  326. 0x00100000306: 'VK_HOME',
  327. 0x00100000307: 'VK_NEXT',
  328. 0x00100000308: 'VK_PRIOR',
  329. 0x00100000401: 'VK_CLEAR',
  330. 0x00100000407: 'VK_INSERT',
  331. 0x00100000504: 'VK_CANCEL',
  332. 0x00100000506: 'VK_EXECUTE',
  333. 0x00100000508: 'VK_HELP',
  334. 0x00100000509: 'VK_PAUSE',
  335. 0x0010000050c: 'VK_SELECT',
  336. 0x00100000608: 'VK_PRINT',
  337. 0x00100000705: 'VK_CONVERT',
  338. 0x00100000706: 'VK_FINAL',
  339. 0x00100000711: 'VK_HANGUL',
  340. 0x00100000712: 'VK_HANJA',
  341. 0x00100000713: 'VK_JUNJA',
  342. 0x00100000718: 'VK_KANA',
  343. 0x00100000719: 'VK_KANJI',
  344. 0x00100000801: 'VK_F1',
  345. 0x00100000802: 'VK_F2',
  346. 0x00100000803: 'VK_F3',
  347. 0x00100000804: 'VK_F4',
  348. 0x00100000805: 'VK_F5',
  349. 0x00100000806: 'VK_F6',
  350. 0x00100000807: 'VK_F7',
  351. 0x00100000808: 'VK_F8',
  352. 0x00100000809: 'VK_F9',
  353. 0x0010000080a: 'VK_F10',
  354. 0x0010000080b: 'VK_F11',
  355. 0x0010000080c: 'VK_F12',
  356. 0x00100000d2b: 'Apps',
  357. 0x00200000002: 'VK_SLEEP',
  358. 0x00200000100: 'VK_CONTROL',
  359. 0x00200000101: 'RControl',
  360. 0x00200000102: 'VK_SHIFT',
  361. 0x00200000103: 'RShift',
  362. 0x00200000104: 'VK_MENU',
  363. 0x00200000105: 'RAlt',
  364. 0x002000001f0: 'VK_CONTROL',
  365. 0x002000001f2: 'VK_SHIFT',
  366. 0x002000001f4: 'VK_MENU',
  367. 0x002000001f6: 'Meta',
  368. 0x0020000022a: 'VK_MULTIPLY',
  369. 0x0020000022b: 'VK_ADD',
  370. 0x0020000022d: 'VK_SUBTRACT',
  371. 0x0020000022e: 'VK_DECIMAL',
  372. 0x0020000022f: 'VK_DIVIDE',
  373. 0x00200000230: 'VK_NUMPAD0',
  374. 0x00200000231: 'VK_NUMPAD1',
  375. 0x00200000232: 'VK_NUMPAD2',
  376. 0x00200000233: 'VK_NUMPAD3',
  377. 0x00200000234: 'VK_NUMPAD4',
  378. 0x00200000235: 'VK_NUMPAD5',
  379. 0x00200000236: 'VK_NUMPAD6',
  380. 0x00200000237: 'VK_NUMPAD7',
  381. 0x00200000238: 'VK_NUMPAD8',
  382. 0x00200000239: 'VK_NUMPAD9',
  383. };
  384. /// flutter/packages/flutter/lib/src/services/keyboard_key.dart -> _debugName
  385. /// see [PhysicalKeyboardKey.debugName] -> _debugName
  386. const Map<int, String> physicalKeyMap = <int, String>{
  387. 0x00010082: 'VK_SLEEP',
  388. 0x00070004: 'VK_A',
  389. 0x00070005: 'VK_B',
  390. 0x00070006: 'VK_C',
  391. 0x00070007: 'VK_D',
  392. 0x00070008: 'VK_E',
  393. 0x00070009: 'VK_F',
  394. 0x0007000a: 'VK_G',
  395. 0x0007000b: 'VK_H',
  396. 0x0007000c: 'VK_I',
  397. 0x0007000d: 'VK_J',
  398. 0x0007000e: 'VK_K',
  399. 0x0007000f: 'VK_L',
  400. 0x00070010: 'VK_M',
  401. 0x00070011: 'VK_N',
  402. 0x00070012: 'VK_O',
  403. 0x00070013: 'VK_P',
  404. 0x00070014: 'VK_Q',
  405. 0x00070015: 'VK_R',
  406. 0x00070016: 'VK_S',
  407. 0x00070017: 'VK_T',
  408. 0x00070018: 'VK_U',
  409. 0x00070019: 'VK_V',
  410. 0x0007001a: 'VK_W',
  411. 0x0007001b: 'VK_X',
  412. 0x0007001c: 'VK_Y',
  413. 0x0007001d: 'VK_Z',
  414. 0x0007001e: 'VK_1',
  415. 0x0007001f: 'VK_2',
  416. 0x00070020: 'VK_3',
  417. 0x00070021: 'VK_4',
  418. 0x00070022: 'VK_5',
  419. 0x00070023: 'VK_6',
  420. 0x00070024: 'VK_7',
  421. 0x00070025: 'VK_8',
  422. 0x00070026: 'VK_9',
  423. 0x00070027: 'VK_0',
  424. 0x00070028: 'VK_ENTER',
  425. 0x00070029: 'VK_ESCAPE',
  426. 0x0007002a: 'VK_BACK',
  427. 0x0007002b: 'VK_TAB',
  428. 0x0007002c: 'VK_SPACE',
  429. 0x0007002d: 'VK_MINUS',
  430. 0x0007002e: 'VK_PLUS', // it is =
  431. 0x0007002f: 'VK_LBRACKET',
  432. 0x00070030: 'VK_RBRACKET',
  433. 0x00070033: 'VK_SEMICOLON',
  434. 0x00070034: 'VK_QUOTE',
  435. 0x00070036: 'VK_COMMA',
  436. 0x00070038: 'VK_SLASH',
  437. 0x00070039: 'VK_CAPITAL',
  438. 0x0007003a: 'VK_F1',
  439. 0x0007003b: 'VK_F2',
  440. 0x0007003c: 'VK_F3',
  441. 0x0007003d: 'VK_F4',
  442. 0x0007003e: 'VK_F5',
  443. 0x0007003f: 'VK_F6',
  444. 0x00070040: 'VK_F7',
  445. 0x00070041: 'VK_F8',
  446. 0x00070042: 'VK_F9',
  447. 0x00070043: 'VK_F10',
  448. 0x00070044: 'VK_F11',
  449. 0x00070045: 'VK_F12',
  450. 0x00070049: 'VK_INSERT',
  451. 0x0007004a: 'VK_HOME',
  452. 0x0007004b: 'VK_PRIOR', // Page Up
  453. 0x0007004c: 'VK_DELETE',
  454. 0x0007004d: 'VK_END',
  455. 0x0007004e: 'VK_NEXT', // Page Down
  456. 0x0007004f: 'VK_RIGHT',
  457. 0x00070050: 'VK_LEFT',
  458. 0x00070051: 'VK_DOWN',
  459. 0x00070052: 'VK_UP',
  460. 0x00070053: 'Num Lock', // TODO rust not impl
  461. 0x00070054: 'VK_DIVIDE', // numpad
  462. 0x00070055: 'VK_MULTIPLY',
  463. 0x00070056: 'VK_SUBTRACT',
  464. 0x00070057: 'VK_ADD',
  465. 0x00070058: 'VK_ENTER', // num enter
  466. 0x00070059: 'VK_NUMPAD1',
  467. 0x0007005a: 'VK_NUMPAD2',
  468. 0x0007005b: 'VK_NUMPAD3',
  469. 0x0007005c: 'VK_NUMPAD4',
  470. 0x0007005d: 'VK_NUMPAD5',
  471. 0x0007005e: 'VK_NUMPAD6',
  472. 0x0007005f: 'VK_NUMPAD7',
  473. 0x00070060: 'VK_NUMPAD8',
  474. 0x00070061: 'VK_NUMPAD9',
  475. 0x00070062: 'VK_NUMPAD0',
  476. 0x00070063: 'VK_DECIMAL',
  477. 0x00070075: 'VK_HELP',
  478. 0x00070077: 'VK_SELECT',
  479. 0x00070088: 'VK_KANA',
  480. 0x0007008a: 'VK_CONVERT',
  481. 0x000700e0: 'VK_CONTROL',
  482. 0x000700e1: 'VK_SHIFT',
  483. 0x000700e2: 'VK_MENU',
  484. 0x000700e3: 'Meta',
  485. 0x000700e4: 'RControl',
  486. 0x000700e5: 'RShift',
  487. 0x000700e6: 'RAlt',
  488. 0x000700e7: 'RWin',
  489. 0x000c00b1: 'VK_PAUSE',
  490. 0x000c00cd: 'VK_PAUSE',
  491. 0x000c019e: 'LOCK_SCREEN',
  492. 0x000c0208: 'VK_PRINT',
  493. };
  494. /// The windows targets in the publish time order.
  495. enum WindowsTarget {
  496. naw, // not a windows target
  497. xp,
  498. vista,
  499. w7,
  500. w8,
  501. w8_1,
  502. w10,
  503. w11
  504. }
  505. /// A convenient method to transform a build number to the corresponding windows version.
  506. extension WindowsTargetExt on int {
  507. WindowsTarget get windowsVersion => getWindowsTarget(this);
  508. }
  509. const kCheckSoftwareUpdateFinish = 'check_software_update_finish';