{"id":18331998,"url":"https://github.com/mrousavy/hotkeys","last_synced_at":"2025-04-06T03:33:31.073Z","repository":{"id":44406621,"uuid":"78554429","full_name":"mrousavy/Hotkeys","owner":"mrousavy","description":":abc: A small C# (.NET) Library which allows binding of global HotKeys to any Application's Windows (including Windows Apps such as explorer.exe), even in Background. (using P/Invokes)","archived":false,"fork":false,"pushed_at":"2020-07-30T11:21:21.000Z","size":2573,"stargazers_count":86,"open_issues_count":1,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-21T16:21:18.539Z","etag":null,"topics":["bindings","dotnet","global-hotkeys","hotkeys","key","library","windows"],"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/mrousavy.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":"mrousavy","ko_fi":"mrousavy","custom":["https://paypal.me/mrousavy"]}},"created_at":"2017-01-10T16:57:37.000Z","updated_at":"2025-02-04T22:09:38.000Z","dependencies_parsed_at":"2022-07-14T19:01:02.957Z","dependency_job_id":null,"html_url":"https://github.com/mrousavy/Hotkeys","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2FHotkeys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2FHotkeys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2FHotkeys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrousavy%2FHotkeys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrousavy","download_url":"https://codeload.github.com/mrousavy/Hotkeys/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430838,"owners_count":20937873,"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","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":["bindings","dotnet","global-hotkeys","hotkeys","key","library","windows"],"created_at":"2024-11-05T19:36:49.403Z","updated_at":"2025-04-06T03:33:29.861Z","avatar_url":"https://github.com/mrousavy.png","language":"C#","funding_links":["https://github.com/sponsors/mrousavy","https://ko-fi.com/mrousavy","https://paypal.me/mrousavy","https://ko-fi.com/F1F8CLXG'"],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://github.com/mrousavy/Hotkeys/blob/master/Images/Logo.png?raw=true\" width=\"42\"\u003e Hotkeys\nA small C# (.NET) Library which allows binding of global HotKeys to any Application's Windows (including Windows Apps such as `explorer.exe`), even in Background. (using P/Invokes)\n\n\n# Install\n\nInstall from [NuGet](https://www.nuget.org/packages/GlobalHotkeys)\n\n```\nInstall-Package GlobalHotkeys\n```\n[![NuGet](https://img.shields.io/nuget/dt/GlobalHotkeys.svg)](https://www.nuget.org/packages/GlobalHotkeys/) \n\n\u003e _(or [download the Library (.dll)](https://raw.githubusercontent.com/mrousavy/Hotkeys/master/Downloads/Hotkeys.dll) manually)_\n\n\n\u003ca href='https://ko-fi.com/F1F8CLXG' target='_blank'\u003e\u003cimg height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi2.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' /\u003e\u003c/a\u003e\n\n# Usage\n\nExample _(C#, in a WPF Application)_:\n```cs\nusing mrousavy;\n// ...\nvar key = new HotKey(\n    (ModifierKeys.Control | ModifierKeys.Alt), \n    Key.S, \n    this, \n    (hotkey) =\u003e {\n        MessageBox.Show(\"Ctrl + Alt + S was pressed!\");\n    }\n);\n// ...\nkey.Dispose();\n```\n\n\u003e Note #1: Since `HotKey` implements the [`IDisposable` interface](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable?view=netcore-3.1), you must call `Dispose()` to unregister the Hotkey, e.g. when your Window closes. Keep in mind that when you're using `using(...) { ... }`, the HotKey gets unregistered and disposed once you exit the using-statement's scope.\n\n\u003e Note #2: Use the binary **or** operator (`|`) to combine key combinations for the constructor.\n\n\u003e Note #3: Use a Window Reference as the third Argument. This may be a [WPF `Window`](https://docs.microsoft.com/en-us/dotnet/api/system.windows.window?view=netcore-3.1), a [`WindowInteropHelper`](https://docs.microsoft.com/en-us/dotnet/api/system.windows.interop.windowinterophelper?view=netcore-3.1), or a Window Handle ([`IntPtr`](https://stackoverflow.com/questions/1953582/how-to-i-get-the-window-handle-by-giving-the-process-name-that-is-running)). So you can use your own WPF/WinForms Window, as well as another process's Window using it's Handle. Keep in mind that this is sketchy behaviour and not the intention of this library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrousavy%2Fhotkeys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrousavy%2Fhotkeys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrousavy%2Fhotkeys/lists"}