unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44973: Add a macOS global hotkey function
@ 2020-11-30 21:01 j
  2020-12-08 20:39 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 19+ messages in thread
From: j @ 2020-11-30 21:01 UTC (permalink / raw)
  To: 44973

[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]

MacOS makes it very difficult to assign global hotkeys to focus Emacs.
For example, if I'm in another program, and I want to launch/focus Emacs
with "Alt-SPC", it can't just be set in the system preferences; I'd need to
use a 3rd-party program like skhd.

Would it be possible to add a function or hook to Emacs which registers one
or more global hotkeys (using addGlobalMonitorForEventsMatchingMask), and
then when the hotkey is pressed, run an elisp function?

For example, by creating a "ns-register-global hotkey" function, where the
user could choose a keybinding (maybe "ALT-SPC"), and letting the user
provide a hook function (maybe "org-capture-stuff")

I intend this feature to be used for something like an Alfred replacement,
as described here: https://www.mattduck.com/emacs-fuzzy-launcher.html .

Even if it's rare for Emacs to implement an OS-specific feature, there is
some precedent on Windows. If you look at w32-register-hot-keys, it's
similar to, but different from my request.

The implementation in nsterm.m should be simple, but it requires Obj-C and
Emacs-specific development knowledge.

Thanks!

[-- Attachment #2: Type: text/html, Size: 1570 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-01-06  5:15 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-30 21:01 bug#44973: Add a macOS global hotkey function j
2020-12-08 20:39 ` Lars Ingebrigtsen
2020-12-21  0:40   ` j
2020-12-21  4:34     ` Lars Ingebrigtsen
2020-12-30  4:10       ` j
2020-12-30 11:01         ` Alan Third
2020-12-30 17:08         ` Eli Zaretskii
2021-01-04  5:13           ` j
2021-01-04 17:09             ` Eli Zaretskii
2021-01-05  8:25               ` Lars Ingebrigtsen
2021-01-05  8:26                 ` Lars Ingebrigtsen
2021-01-05 15:04                   ` Eli Zaretskii
2021-01-05 15:04                 ` Eli Zaretskii
2021-01-06  5:15                 ` Richard Stallman
2021-01-06  5:02               ` Richard Stallman
2020-12-21  8:12     ` Alan Third
2020-12-21 16:18       ` Eli Zaretskii
2020-12-21 16:34         ` Alan Third
2020-12-22  5:20           ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).