{"id":13563259,"url":"https://github.com/golang-design/hotkey","last_synced_at":"2025-10-05T17:21:59.139Z","repository":{"id":40423102,"uuid":"342043984","full_name":"golang-design/hotkey","owner":"golang-design","description":"⌨️ cross-platform hotkey package","archived":false,"fork":false,"pushed_at":"2023-02-03T09:55:46.000Z","size":1067,"stargazers_count":244,"open_issues_count":8,"forks_count":13,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-08-20T01:40:42.717Z","etag":null,"topics":["hotkey","hotkeys","keyboard","linux","macos","shortcut","shortcuts","windows","x11"],"latest_commit_sha":null,"homepage":"https://golang.design/x/hotkey","language":"Go","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/golang-design.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["changkun"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-02-24T21:44:17.000Z","updated_at":"2025-08-16T10:41:00.000Z","dependencies_parsed_at":"2023-02-18T05:31:32.820Z","dependency_job_id":null,"html_url":"https://github.com/golang-design/hotkey","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/golang-design/hotkey","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golang-design%2Fhotkey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golang-design%2Fhotkey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golang-design%2Fhotkey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golang-design%2Fhotkey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/golang-design","download_url":"https://codeload.github.com/golang-design/hotkey/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golang-design%2Fhotkey/sbom","scorecard":{"id":434375,"data":{"date":"2025-08-11","repo":{"name":"github.com/golang-design/hotkey","commit":"605a1a95e41e81259a7d126173c3f7cab17e40cc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":1,"reason":"Found 2/20 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/hotkey.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/golang-design/hotkey/hotkey.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/hotkey.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/golang-design/hotkey/hotkey.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/hotkey.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"15 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2023-1572 / GHSA-qgc7-mgm3-q253","Warn: Project is vulnerable to: GO-2023-1990 / GHSA-j3p8-6mrq-6g7h","Warn: Project is vulnerable to: GO-2023-1989 / GHSA-x92r-3vfx-4cv3","Warn: Project is vulnerable to: GO-2024-2937 / GHSA-9phm-fm57-rhg8","Warn: Project is vulnerable to: GO-2022-0969 / GHSA-69cg-p879-7622","Warn: Project is vulnerable to: GO-2023-1495 / GHSA-fxg5-wq6x-vr4w","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T04:13:56.825Z","repository_id":40423102,"created_at":"2025-08-19T04:13:56.825Z","updated_at":"2025-08-19T04:13:56.825Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278486610,"owners_count":25995005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["hotkey","hotkeys","keyboard","linux","macos","shortcut","shortcuts","windows","x11"],"created_at":"2024-08-01T13:01:16.956Z","updated_at":"2025-10-05T17:21:59.094Z","avatar_url":"https://github.com/golang-design.png","language":"Go","funding_links":["https://github.com/sponsors/changkun"],"categories":["Go"],"sub_categories":[],"readme":"# hotkey [![PkgGoDev](https://pkg.go.dev/badge/golang.design/x/hotkey)](https://pkg.go.dev/golang.design/x/hotkey) ![](https://changkun.de/urlstat?mode=github\u0026repo=golang-design/hotkey) ![hotkey](https://github.com/golang-design/hotkey/workflows/hotkey/badge.svg?branch=main)\n\ncross platform hotkey package in Go\n\n```go\nimport \"golang.design/x/hotkey\"\n```\n\n## Features\n\n- Cross platform supports: macOS, Linux (X11), and Windows\n- Global hotkey registration without focus on a window\n\n## API Usage\n\nPackage hotkey provides the basic facility to register a system-level\nglobal hotkey shortcut so that an application can be notified if a user\ntriggers the desired hotkey. A hotkey must be a combination of modifiers\nand a single key.\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\n\t\"golang.design/x/hotkey\"\n\t\"golang.design/x/hotkey/mainthread\"\n)\n\nfunc main() { mainthread.Init(fn) } // Not necessary when use in Fyne, Ebiten or Gio.\nfunc fn() {\n\thk := hotkey.New([]hotkey.Modifier{hotkey.ModCtrl, hotkey.ModShift}, hotkey.KeyS)\n\terr := hk.Register()\n\tif err != nil {\n\t\tlog.Fatalf(\"hotkey: failed to register hotkey: %v\", err)\n\t\treturn\n\t}\n\n\tlog.Printf(\"hotkey: %v is registered\\n\", hk)\n\t\u003c-hk.Keydown()\n\tlog.Printf(\"hotkey: %v is down\\n\", hk)\n\t\u003c-hk.Keyup()\n\tlog.Printf(\"hotkey: %v is up\\n\", hk)\n\thk.Unregister()\n\tlog.Printf(\"hotkey: %v is unregistered\\n\", hk)\n}\n```\n\nNote platform specific details:\n\n- On macOS, due to the OS restriction (other platforms does not have this\n  restriction), hotkey events must be handled on the \"main thread\".\n  Therefore, in order to use this package properly, one must start an OS\n  main event loop on the main thread, For self-contained applications,\n  using [golang.design/x/hotkey/mainthread](https://pkg.go.dev/golang.design/x/hotkey/mainthread)\n  is possible. It is uncessary or applications based on other GUI frameworks,\n  such as fyne, ebiten, or Gio. See the \"[./examples](./examples)\" folder\n  for more examples.\n- On Linux (X11), when AutoRepeat is enabled in the X server, the Keyup\n  is triggered automatically and continuously as Keydown continues.\n- On Linux (X11), some keys may be mapped to multiple Mod keys. To\n  correctly register the key combination, one must use the correct\n  underlying keycode combination. For example, a regular Ctrl+Alt+S\n  might be registered as: Ctrl+Mod2+Mod4+S.\n- If this package did not include a desired key, one can always provide\n  the keycode to the API. For example, if a key code is 0x15, then the\n  corresponding key is `hotkey.Key(0x15)`.\n\n## Examples\n\n| Description | Folder |\n|:------------|:------:|\n| A minimum example | [minimum](./examples/minimum/main.go) |\n| Register multiple hotkeys | [multiple](./examples/multiple/main.go) |\n| A example to use in GLFW | [glfw](./examples/glfw/main.go) |\n| A example to use in Fyne | [fyne](./examples/fyne/main.go) |\n| A example to use in Ebiten | [ebiten](./examples/ebiten/main.go) |\n| A example to use in Gio | [gio](./examples/gio/main.go) |\n\n## Who is using this package?\n\nThe main purpose of building this package is to support the\n[midgard](https://changkun.de/s/midgard) project.\n\nTo know more projects, check our [wiki](https://github.com/golang-design/hotkey/wiki) page.\n\n## License\n\nMIT | \u0026copy; 2021 The golang.design Initiative Authors, written by [Changkun Ou](https://changkun.de).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgolang-design%2Fhotkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgolang-design%2Fhotkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgolang-design%2Fhotkey/lists"}