Opened 11 years ago

Closed 10 years ago

Last modified 7 years ago

#12354 closed enhancement (fixed)

Implement RegisterHotKey for operating systems other than Windows

Reported by: Q Owned by: csomor
Priority: normal Milestone:
Component: base Version: stable-latest
Keywords: RegisterHotKey simple Cc: jekis@…
Blocked By: Blocking:
Patch: no


There are a few platform-specific methods for obtaining this functionality--many of these, such as using PyObjC and the Mac OSX Native hotkey event code are incompatible with WX as they require their own event loop be run in the main thread. I ask that the WX version of RegisterHotKey is updated to work on OSX and X11.

Change History (16)

comment:1 Changed 11 years ago by vadz

  • Milestone 2.9.2 deleted
  • Priority changed from normal to low
  • Status changed from new to confirmed

Pointers to the documentation about implementing this functionality would be welcome.

comment:2 Changed 11 years ago by Q

Here is a link to registration of global hotkeys on OSX using Objective C:
I have been unable to find specific reference code for X11, simply confirmations that is possible using xlib. Thank you very much for your time and assistance with this.

comment:3 Changed 11 years ago by JEkis

  • Cc jekis@… added

comment:4 Changed 11 years ago by seanybob

  • Priority changed from low to normal

Google groups thread that referred me here:

Code suggested in thread that might help for OSX:

Sadly, I can't help much with this, being MAC/ObjC-challenged myself. Just wanted to let people know that there is an active interest in this feature from the community though, if someone has the ability to add it.

comment:5 Changed 11 years ago by vadz

  • Keywords simple added

FWIW this seems pretty straightforward to do so anybody minimally fluent in C* should be able to add implementation of this without too much problems... I might do it myself in the future but I have a lot of higher priority tickets to look at first so please don't hesitate to preempt me.

comment:6 Changed 11 years ago by ronarts12

I'd like to add a me too... I'll look into adding the functionality myself if I find the time to learn about OSX development...

comment:7 Changed 11 years ago by csomor

  • Owner set to csomor
  • Status changed from confirmed to accepted

comment:8 Changed 11 years ago by seanybob

Just wanted to make sure this ticket's existence is still known. I see that Csomor accepted it but haven't seen any updates in a couple months (Not intending to be rude, but just checking in - I'm sure Csomor is a busy guy!)

comment:9 Changed 11 years ago by SC

(In [67574]) implementation of HotKey, see #12354

comment:10 Changed 11 years ago by csomor

please - everybody who was interested in this - test the current implementation and report back - thanks

comment:11 Changed 10 years ago by robind

There does not appear to be a way to turn on wxUSE_HOTKEY via configure.

comment:12 Changed 10 years ago by VZ

(In [68968]) Add wxUSE_HOTKEY support to configure.

Add --enable-hotkey switch to allow enabling hot keys support and enable it by
default under MSW and OS X that do support them but disable it elsewhere to
avoid unnecessary warnings about them being unsupported.

See #12354.

comment:13 Changed 10 years ago by robind

  • Resolution set to fixed
  • Status changed from accepted to closed

It seems to be working well, at least on wxOSX-Cocoa, so I'll go ahead and close this ticket.

My test case is here:

comment:14 Changed 7 years ago by HighCommander4

Does this remain unimplemented on Linux? It's not clear, as the bug title talks about "operating systems other than Windows", but the linked patches only refer to OS X.

comment:15 Changed 7 years ago by Vadim Zeitlin <vadim@…>

In ad92074535daaeb4ccd2870a1f36e580d24472bc/git-wxWidgets:

Update RegisterHotKey() documentation to mention OS X support.

This function is implemented in wxOSX too, not just wxMSW.

See #12354.

comment:16 Changed 7 years ago by vadz

Yes, it's still not implemented in wxGTK, but I don't know how to implement it there.

Note: See TracTickets for help on using tickets.