Re: Windows application hot key - let me explain
- Posted by Andrew Katz <Akatz712 at gmail.com> May 18, 2007
- 576 views
Juergen Luethje wrote: > > Andrew Katz wrote: > > > I have been searching for an application which does the following, but I did > > not find it, so I will ask here: > > > > The application ALWAYS detects a particular key being pressed (lets say > > ALT+H) > > and does something. I have played around with keypress and keydown events, > > but > > the behavior of these changes and not all controls know about them. > > You might want to use GetAsyncKeyState(), see > <<a > href="http://msdn2.microsoft.com/en-us/library/ms646293.aspx">http://msdn2.microsoft.com/en-us/library/ms646293.aspx</a>> > > Regards, > Juergen Ironically, I found the answer in the IDE which does react to keys. The way to do it is:
procedure Screen_keydown(integer Self, integer Event, sequence Params) -- Application hot key detector if Params[1] = VK_ESCAPE then -- do something elsif Params[1] = whatever then -- yada yada yada end if end procedure setHandler(Screen, w32HKeyDown, routine_id("Screen_keydown"))
The irony is the control 'Screen', since I do not know if the IDE supports that itself. Andy Katz B.S. Computer Science, 1978 Rensselaer Polytechnic Institute (RPI)