From: Bill Kelly Date: 2005-03-23T05:26:52+09:00 Subject: Re: Windows hotkeys in Ruby From: "Nicolas Delsaux" > > On Wed, 23 Mar 2005 02:06:09 +0900, Bill Kelly wrote: > > > > There's RegisterHotKey() > > http://www.google.com/search?hl=en&q=registerhotkey > > > > You might be able to call that via Win32API, but, you'll > > need a window handle too. > > Thanks. > From what I can see, " If this parameter is NULL, WM_HOTKEY messages > are posted to the message queue of the calling thread and must be > processed in the message loop.". Is it to say that, provided i have a > running Ruby thread (or the local equivalent to this Java word) > running, I will be able to recieve "events" ? > If it is the case, it seems to me rather simple, isn't it ? Ah - cool, I missed the part about passing in NULL. Note, that all Ruby threads really run in the same operating system thread. This means if you call an operating system function that blocks, all of your ruby threads will wait until it returns. This can sometimes make things challenging; but for what you're doing I don't think it will be an issue. Sounds like you can call RegisterHotKey() ... then start calling either PeekMessage() or GetMessage() and watch for your WM_HOTKEY messages. Regards, Bill