{"id":15684928,"url":"https://github.com/code-hex/hotkeycapture","last_synced_at":"2025-03-30T10:45:54.695Z","repository":{"id":71654180,"uuid":"52198525","full_name":"Code-Hex/HotKeyCapture","owner":"Code-Hex","description":"This is a sandboxed of custom global hotkeys in Swift using HotKeyCapture","archived":false,"fork":false,"pushed_at":"2016-03-08T15:55:07.000Z","size":66,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T12:45:57.625Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","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/Code-Hex.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2016-02-21T09:01:08.000Z","updated_at":"2019-12-25T18:45:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"fa724d19-0d45-41f9-8676-497f46399c43","html_url":"https://github.com/Code-Hex/HotKeyCapture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Hex%2FHotKeyCapture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Hex%2FHotKeyCapture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Hex%2FHotKeyCapture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Hex%2FHotKeyCapture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Code-Hex","download_url":"https://codeload.github.com/Code-Hex/HotKeyCapture/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246307931,"owners_count":20756478,"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":[],"created_at":"2024-10-03T17:22:27.093Z","updated_at":"2025-03-30T10:45:54.657Z","avatar_url":"https://github.com/Code-Hex.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HotKeyCapture\nThis is a sandboxed of custom global hotkeys in Swift using HotKeyCapture\n## What's this??\nHotKeyCapture is an easy to use Cocoa class for registering an application to respond to system key events, or \"hotkeys\".  \nA global hotkey is a key combination that always executes a specific action, regardless of which app is frontmost. For example, the Mac OS X default hotkey of \"command-space\" shows the Spotlight search bar, even if Finder is not the frontmost application.  \n##Usage\nIf using cocoapods, lucky!! that easy.  \nTo prepare Podfile and like this in Podfile:  \n```\nplatform :osx, '10.10'\nuse_frameworks!\n\npod 'HotKeyCapture', :git =\u003e 'https://github.com/Code-Hex/HotKeyCapture.git'\n```\nand run  \n```\npod install\n```\nIf you don't use cocoapods, you can prepare these files. \n- HotKeyCapture.xcodeproj\n- HotKeyCapture\n  - HotKeyCapture.h\n  - HotKeyCapture.swift\n  - HotKeyCaptureCenter.swift\n  - HotKeyCombo.swift\n  - HotKeyVariable.swift\n  - Info.plist // Maybe unnecessary...  \n\nThese files into your project.  \n##Reference\n###class HotKeyCapture\n```\nvar appActivationKeyCombo: HotKeyCombo { get }\n```\nGet activation HotKeyCombo instance.  \n```\nfunc setAppActivationKeyCombo(aCombo: HotKeyCombo)\n```\nif want to active to HotKeyCombo instance, use this.  \n```\nfunc getActivationHotKey() -\u003e HotKeyVariable\n```\nGet activation HotKeyVariable instance.  \n```\nfunc getActivationKeyCombo() -\u003e HotKeyCombo\n```\nGet HotKeyVariable instance while set some HotKeyVariable instance variable  \n```\nfunc registerMethodWithTarget(target target: AnyObject, method: String) -\u003e Bool\nfunc registerMethodWithTarget(target target: AnyObject, method: String, afterDelay: NSTimeInterval) -\u003e Bool\n```\nThis method able to register \"method called by hotkey\" using target and method string.  \n```\nfunc registerBlock(block block: ()-\u003eVoid) -\u003e Bool\nfunc registerBlock(block block: ()-\u003eVoid, afterDelay: NSTimeInterval) -\u003e Bool\n```\nThis method able to register \"method called by hotkey\" using closure.  \n###class HotKeyVariable\n\n```\nvar name: String // registration key for hotkey\nvar target: AnyObject // target for performselector etc...\nvar action: String // method name\nvar KeyCombo: HotKeyCombo\nvar carbonHotKey: EventHotKeyRef\nvar delay: NSTimeInterval\n\nvar completion: () -\u003e Void = {}\n```\nThese variables are going to use when extension.  \n```\nfunc invoke()\n```\nThis method is run registration method.\n###class HotKeyCaptureCenter\n```\nclass var sharedCenter: HotKeyCaptureCenter\n```\nIf you want to use without initialization.\n```\nfunc registerHotKey(hotKey: HotKeyVariable) -\u003e Bool\nfunc unregisterHotKey(hotKey: HotKeyVariable)\nfunc unregisterHotKeyForName(name: String)\nfunc updateHotKey(hk: HotKeyVariable)\nfunc unregisterAllHotKeys() // I don't think to use to anything\n```\nThese methods are going to use when extension or wrapper  \n###class HotKeyCombo\n```\nvar keyCode: Int { get }\nvar modifiers: Int { get }\n```\nGet keyCode or modifiers.\n```\nfunc isValidHotKeyCombo() -\u003e Bool\nfunc isClearCombo() -\u003e Bool // same is reset?\n```\nAs the name.\n```\nclass func clearKeyCombo() -\u003e HotKeyCombo\n```\nReturn cleared HotKeyCombo instance.  \n```\nclass func keyComboWithKeyCode(keyCode keyCode: Int, modifiers: Int) -\u003e HotKeyCombo\n```\nInitialized with the set parameters.  \n```\nclass func stringForCombo(modifiers modifiers: Int, keyCode: Int) -\u003e String\n```\nReturn string by set combo.  \n```\nclass var keyCodesDictionary: [String:String]\n```\nReturn keyCodesDictionary. see source code.  \n```\nvar description: String { get }\n```\nReturn convert keyCode to string + modifiers to string. like \"⌘⌥K\" etc\n##Licence\n[MIT](https://github.com/Code-Hex/HotKeyCapture/blob/master/LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-hex%2Fhotkeycapture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-hex%2Fhotkeycapture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-hex%2Fhotkeycapture/lists"}