Mac OSX Hotkey support.

33 views
Skip to first unread message

seanybob

unread,
Jan 17, 2011, 12:04:32 PM1/17/11
to wx-users
Hey there,
I originally posted this on wxPython-users, but they didn't have a
solution and Robin Dunn suggested I bring it over here. Here is my
original post:
-------------

I'm writing an app that is currently for Windows, but I'm looking to
convert it over to OSX as well soon.

The issue is that while Windows has wxPython's
wx.Window.RegisterHotKey() for hotkeys, Mac doesn't seem to have any
equivalent. The hotkey must be received when my application is running
in the background and doesn't have focus (system-wide hotkey).

Is there no solution?

From my random googlings, I've seen people recommend using PyObjC and
coding the hotkey in ObjC. If that is the only solution, do you know
of any example code for such a thing? As always, thanks for your time.

Vadim Zeitlin

unread,
Jan 17, 2011, 6:31:31 PM1/17/11
to wx-u...@googlegroups.com
On Mon, 17 Jan 2011 09:04:32 -0800 (PST) seanybob <sean...@gmail.com> wrote:

s> The issue is that while Windows has wxPython's


s> wx.Window.RegisterHotKey() for hotkeys, Mac doesn't seem to have any

s> equivalent.

No, this feature is Windows-only.

s> Is there no solution?

I am not a OS X expert so I don't know about this. If it's possible to do
this in Objective C it should be possible (and not too difficult) to do it
in wx too -- but, of course, someone would still need to do it.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Ron Arts

unread,
Jan 18, 2011, 2:46:27 AM1/18/11
to wx-u...@googlegroups.com, seanybob
Op 17-01-11 18:04, seanybob schreef:

> Hey there,
> I originally posted this on wxPython-users, but they didn't have a
> solution and Robin Dunn suggested I bring it over here. Here is my
> original post:
> -------------
>
> I'm writing an app that is currently for Windows, but I'm looking to
> convert it over to OSX as well soon.
>
> The issue is that while Windows has wxPython's
> wx.Window.RegisterHotKey() for hotkeys, Mac doesn't seem to have any
> equivalent. The hotkey must be received when my application is running
> in the background and doesn't have focus (system-wide hotkey).
>
> Is there no solution?
>

This app seems to be able to do it, and there's source available too.
Can you please post back to the list if you found out how to do it?

http://visor.binaryage.com/

Thanks,
Ron

Stefan Csomor

unread,
Jan 18, 2011, 4:02:39 AM1/18/11
to wx-u...@googlegroups.com
Hi

>>The issue is that while Windows has wxPython's
>> wx.Window.RegisterHotKey() for hotkeys, Mac doesn't seem to have any
>> equivalent. The hotkey must be received when my application is running
>> in the background and doesn't have focus (system-wide hotkey).
>>
>> Is there no solution?

the implementation will have to use RegisterEventHotKey, but I don't have
the time to do it right now, you could open a feature request on trac
though, so that we can keep the info together

Best,

Stefan

seanybob

unread,
Jan 18, 2011, 2:16:26 PM1/18/11
to wx-users

> the implementation will have to use RegisterEventHotKey, but I don't have
> the time to do it right now, you could open a feature request on trac
> though, so that we can keep the info together

I saw someone had already opened a similar ticket, so I just commented
on it.

http://trac.wxwidgets.org/ticket/12354

@Ron Arts, I see your link, but I can't do much with it. Perhaps
someone else can, I added it to the trac as well.

seanybob

unread,
Apr 21, 2011, 1:10:17 PM4/21/11
to wx-u...@googlegroups.com
Any news on this? Noticed Csomor accepted it in the Trac several months ago, but no updates.

Ron Arts

unread,
Apr 21, 2011, 2:24:55 PM4/21/11
to wx-u...@googlegroups.com, seanybob
No news it seems. Patches are welcomed of course.

Ron

Op 21-04-11 19:10, seanybob schreef:


> Any news on this? Noticed Csomor accepted it in the Trac several months ago, but no updates.
>

> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to wx-users+u...@googlegroups.com
> or visit http://groups.google.com/group/wx-users

Stefan Csomor

unread,
Apr 22, 2011, 2:10:15 AM4/22/11
to wx-u...@googlegroups.com
Hi

Any news on this? Noticed Csomor accepted it in the Trac several months ago, but no updates.

I accepted to make sure it shows up in my lists, but not as a promise with an ETA. As we don't have funding for wx, we must choose the items to work on very carefully, and right now this means either things that are needed for our own apps or our contracts or seem most important towards 3.0 osx_cocoa.

But it's ok to ping me every few months since this is a request of several people. So I'll have a look and see whether I get things working quickly, if not, it'll be put back again …

Best,

Stefan
Reply all
Reply to author
Forward
0 new messages