{"id":32291853,"url":"https://github.com/suysoftware/hotkey_system","last_synced_at":"2026-02-20T23:01:01.892Z","repository":{"id":209287881,"uuid":"723680628","full_name":"suysoftware/hotkey_system","owner":"suysoftware","description":"A Flutter plugin that allows you to define system-wide and in-app hotkeys (shortcuts) for your desktop applications on Linux, macOS, and Windows. ⌨️  **Features:**  * **System-wide \u0026 In-App Hotkeys:** Register hotkeys that work across your entire system or only within your application. * **Cross-Platform Support:** Works seamlessly on Linux, macOS,","archived":false,"fork":false,"pushed_at":"2024-03-25T21:55:55.000Z","size":1617,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T03:07:27.212Z","etag":null,"topics":["flutter-desktop","flutter-hotkey","hotkeys","keyboard","shortcuts"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suysoftware.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-11-26T12:53:14.000Z","updated_at":"2025-06-19T13:23:13.000Z","dependencies_parsed_at":"2023-11-30T15:28:09.265Z","dependency_job_id":"2f8bb041-6ca5-48eb-9e79-907e8d858cc8","html_url":"https://github.com/suysoftware/hotkey_system","commit_stats":null,"previous_names":["suysoftware/hotkey_system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/suysoftware/hotkey_system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suysoftware%2Fhotkey_system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suysoftware%2Fhotkey_system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suysoftware%2Fhotkey_system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suysoftware%2Fhotkey_system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suysoftware","download_url":"https://codeload.github.com/suysoftware/hotkey_system/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suysoftware%2Fhotkey_system/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29667119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T19:49:36.704Z","status":"ssl_error","status_checked_at":"2026-02-20T19:44:05.372Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flutter-desktop","flutter-hotkey","hotkeys","keyboard","shortcuts"],"created_at":"2025-10-23T03:04:06.316Z","updated_at":"2026-02-20T23:01:01.886Z","avatar_url":"https://github.com/suysoftware.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://firebasestorage.googleapis.com/v0/b/think-buddy.appspot.com/o/default_files%2Fhs_logo.png?alt=media\u0026token=76ffec3d-0d9b-460b-8e62-f5fbec586989\" height=\"256\" alt=\"HotkeySystem\" /\u003e\n\u003c/p\u003e\n\n\nThis plugin allows Flutter desktop apps to defines system/inapp wide hotkey (i.e. shortcut).\n\n---\n\n\n---\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n- [hotkey_system](#hotkey_system)\n  - [Platform Support](#platform-support)\n  - [Quick Start](#quick-start)\n    - [Installation](#installation)\n      - [Linux requirements](#linux-requirements)\n    - [Usage](#usage)\n  - [Who's using it?](#whos-using-it)\n  - [API](#api)\n    - [HotKeySystem](#hotkeysystem)\n  - [Related Links](#related-links)\n  - [License](#license)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Platform Support\n\n| Linux | macOS | Windows |\n| :---: | :---: | :-----: |\n|   ✔️   |   ✔️   |    ✔️    |\n\n## Quick Start\n\n### Installation\n\nAdd this to your package's pubspec.yaml file:\n\n```yaml\ndependencies:\n  hotkey_system: ^0.0.9\n```\n\nOr\n\n```yaml\ndependencies:\n  hotkey_system:\n    git:\n      url: https://github.com/suysoftware/hotkey_system.git\n      ref: main\n```\n#### Linux requirements\n\n- [`keybinder-3.0`](https://github.com/kupferlauncher/keybinder)\n\nRun the following command\n\n```\nsudo apt-get install keybinder-3.0\n```\n\n### Usage\n\n```dart\nimport 'package:hotkey_system/hotkey_system.dart';\n\nvoid main() async {\n  // Must add this line.\n  WidgetsFlutterBinding.ensureInitialized();\n  // For hot reload, `unregisterAll()` needs to be called.\n  await hotKeySystem.unregisterAll();\n\n  runApp(MyApp());\n}\n```\n\nRegister/Unregsiter a system/inapp wide hotkey.\n\n```dart\n// ⌥ + Q\nHotKey _hotKey = HotKey(\n  KeyCode.keyQ,\n  modifiers: [KeyModifier.alt],\n  // Set hotkey scope (default is HotKeyScope.system)\n  scope: HotKeyScope.inapp, // Set as inapp-wide hotkey.\n);\nawait hotKeySystem.register(\n  _hotKey,\n  keyDownHandler: (hotKey) {\n    print('onKeyDown+${hotKey.toJson()}');\n  },\n  // Only works on macOS.\n  keyUpHandler: (hotKey){\n    print('onKeyUp+${hotKey.toJson()}');\n  } ,\n);\n\nawait hotKeySystem.unregister(_hotKey);\n\nawait hotKeySystem.unregisterAll();\n```\n\nUse `HotKeyRecorder` widget to help you record a hotkey.\n\n```dart\nHotKeyRecorder(\n  onHotKeyRecorded: (hotKey) {\n    _hotKey = hotKey;\n    setState(() {});\n  },\n),\n```\n\n\nUse `HotKeyRecorder` widget with initialHotkey\n\n```dart\nHotKeyRecorder(\n  onHotKeyRecorded: (hotKey) {\n    _hotKey = hotKey;\n    setState(() {});\n  },\n  initialHotKey: HotKey.fromJson({\"keyCode\":\"keyR\",\"modifiers\":[\"meta\"],\"identifier\":\"fdf8484b-5249-42bb-b473-d99bfb7bb3e8\",\"scope\":\"system\"})\n),\n```\n\nRegister with identifier\n\n```dart\n// ⌥ + Q\nHotKey _hotKey = HotKey(\n  KeyCode.keyQ,\n  modifiers: [KeyModifier.alt],\n  identifier: \"examleidentifier\"\n  // Set hotkey scope (default is HotKeyScope.system)\n  scope: HotKeyScope.inapp, // Set as inapp-wide hotkey.\n);\nawait hotKeySystem.register(\n  _hotKey,\n  keyDownHandler: (hotKey) {\n    print('onKeyDown+${hotKey.toJson()}');\n  },\n  // Only works on macOS.\n  keyUpHandler: (hotKey){\n    print('onKeyUp+${hotKey.toJson()}');\n  } ,\n);\n\n```\nHotkey.fromJson usage\n\n```dart\nHotKey _hotKey = HotKey.fromJson({\"keyCode\":\"keyR\",\"modifiers\":[\"meta\"],\"identifier\":\"fdf8484b-5249-42bb-b473-d99bfb7bb3e8\",\"scope\":\"system\"})\nawait hotKeySystem.register(\n  _hotKey,\n  keyDownHandler: (hotKey) {\n    print('onKeyDown+${hotKey.toJson()}');\n  },\n  // Only works on macOS.\n  keyUpHandler: (hotKey){\n    print('onKeyUp+${hotKey.toJson()}');\n  } ,\n);\n\n```\n\n\nHotKeyVirtualView usage\n\n```dart\n \nreturn HotKeyVirtualView(HotKey.fromJson({\"keyCode\":\"keyR\",\"modifiers\":[\"meta\"],\"identifier\":\"fdf8484b-5249-42bb-b473-d99bfb7bb3e8\",\"scope\":\"system\"}));\n\n```\n\nPackage Parsers\n```dart\n// Parsing a string to a KeyModifier\nKeyModifier modifier = KeyModifierParser.parse(\"shift\");\n\n// Getting the ModifierKey from a KeyModifier\nModifierKey modKey = modifier.modifierKey;\n\n// Getting LogicalKeyboardKeys from a KeyModifier\nList\u003cLogicalKeyboardKey\u003e keys = modifier.logicalKeys;\n\n// Getting the label for a KeyModifier\nString label = modifier.keyLabel;\n\n// Convert LogicalKeyboardKey to KeyCode\nKeyCode keyCode = KeyCodeParser.fromLogicalKey(LogicalKeyboardKey.keyA);\n\n// Retrieve the LogicalKeyboardKey from a KeyCode\nLogicalKeyboardKey logicalKey = keyCode.logicalKey;\n\n// Parse a string to a KeyCode\nKeyCode parsedKeyCode = KeyCodeParser.parse(\"keyA\");\n\n// Get the key label\nString keyLabel = keyCode.keyLabel;\n\n\n```\nModifiers\n```dart\nKeyModifier.alt // macOS: option \u0026 windows: alt\n\nKeyModifier.shift // macOS: shift \u0026 windows: shift\n\nKeyModifier.meta // macOS: cmd \u0026 windows: windows key\n\nKeyModifier.control // macOS: control \u0026 windows: control\n\n// For Control Key\nString controlKeyLabel = KeyCode.control.keyLabel; // Returns '⌃' on macOS, 'Ctrl' on Windows\n\n// For Shift Key\nString shiftKeyLabel = KeyCode.shift.keyLabel; // Returns '⇧'\n\n// For Alt Key\nString altKeyLabel = KeyCode.alt.keyLabel; // Returns '⌥' on macOS, 'Alt' on Windows\n\n// For Meta Key\nString metaKeyLabel = KeyCode.meta.keyLabel; // Returns '⌘' on macOS, '⊞' on Windows\n```\nHotKey Object\n```dart\nenum HotKeyScope {\n  system,\n  inapp,\n}\n\nclass HotKey {\n  HotKey(\n    this.keyCode, {\n    this.modifiers,\n    String? identifier,\n    HotKeyScope? scope,\n  }) {\n    if (identifier != null) this.identifier = identifier;\n    if (scope != null) this.scope = scope;\n  }\n\n  factory HotKey.fromJson(Map\u003cString, dynamic\u003e json) {\n    return HotKey(\n      KeyCodeParser.parse(json['keyCode']),\n      modifiers: List\u003cString\u003e.from(json['modifiers'])\n          .map((e) =\u003e KeyModifierParser.parse(e))\n          .toList(),\n      identifier: json['identifier'],\n      scope: HotKeyScope.values.firstWhere(\n        (e) =\u003e e.name == json['scope'],\n        orElse: () =\u003e HotKeyScope.system,\n      ),\n    );\n  }\n\n  KeyCode keyCode;\n  List\u003cKeyModifier\u003e? modifiers;\n  String identifier = DateTime.now().millisecondsSinceEpoch.toString();\n  HotKeyScope scope = HotKeyScope.system;\n\n  Map\u003cString, dynamic\u003e toJson() {\n    return {\n      'keyCode': keyCode.name,\n      'modifiers': modifiers?.map((e) =\u003e e.name).toList() ?? [],\n      'identifier': identifier,\n      'scope': scope.name.toString(),\n    };\n  }\n\n  @override\n  String toString() {\n    return '${modifiers?.map((e) =\u003e e.keyLabel).join('')}${keyCode.keyLabel}';\n  }\n}\n```\n\n\u003e Please see the example app of this plugin for a full example.\n\n## Who's using it?\n\n- [ThinkBuddy](https://thinkbuddy.ai) - Made for native MacOS experience integrated with AI\n\n## API\n\n### HotKeySystem\n\n| Method        | Description                               | Linux | macOS | Windows |\n| ------------- | ----------------------------------------- | ----- | ----- | ------- |\n| register      | register an system/inapp wide hotkey.     | ✔️     | ✔️     | ✔️       |\n| unregister    | unregister an system/inapp wide hotkey.   | ✔️     | ✔️     | ✔️       |\n| unregisterAll | unregister all system/inapp wide hotkeys. | ✔️     | ✔️     | ✔️       |\n\n## Related Links\n\n- https://github.com/soffes/HotKey\n- https://github.com/kupferlauncher/keybinder\n- https://github.com/leanflutter/hotkey_manager\n\n## License\n\n[MIT](./LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuysoftware%2Fhotkey_system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuysoftware%2Fhotkey_system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuysoftware%2Fhotkey_system/lists"}