How to intercept a hot key in Cocoa when the application window is not active

前端 未结 2 1495
花落未央
花落未央 2021-02-01 00:02

I am trying to create a utility that doesn\'t open a window when executed, and that would be activated from a hot key; I read that currently Cocoa doesn\'t have a function for t

2条回答
  •  广开言路
    2021-02-01 00:36

    Take a look at Shortcut Recorder (http://wafflesoftware.net/shortcut/) a framework that uses the Carbon Event Manager for Global Hotkeys it also allows you to change the user to change the HotKey (if this is what you want).

    And see this Project/Code on how to implement it : http://github.com/sdegutis/SDGlobalShortcuts.

提交回复
热议问题