Thanks, Cosmin!

As a temporary solution, I added a timer to close the combo box after a 
couple of seconds giving the user long enough to look at the list, then 
he can move through the list one item at a time with a foot pedal 
combination.

I like your first (TJvApplicationHotKey wrapper) solution and will use 
that to give full control back to the user on how long the drop down 
will stay open. Once using the foot pedal, its pretty hard to minimize 
or switch to another application, so that issue is minimized.


Thanks again,

Chuck Belanger
> That's probably because the menu shortcut gets acted upon using the
> dialog command notification messages. My guess is that those messages
> get sent to the combo box drop down window while the window is visible
> and that window has no idea what to do with them.
>
> There are a number of things you can do to solve this:
>
> You can register a global HotKey using RegisterHotKey or the
> TJvApplicationHotKey wrapper in the Jedi VCL. Using this will get the
> job done (I've tested it with a drop down box on a form) BUT be aware
> the hot key is truly global: You can minimize your application or switch
> to a different application, type your keyboard shortcut and the code
> will run just fine!
>
> If the global hot key functionality seems excessive for your
> application, you may try other solutions, but the
> TJvApplicationHotKey/RegisterHotKey solution is VERY simple compared to
> any of the alternatives:
>
> Alternative #1: Register a keyboard hook using SetWindowsHookEx - you'll
> see all keyboard events going to your application (or any other
> application, depending on how you set things up).
>
> Alternative #2: Run your own message pump. Take a look at how ShowModal
> work (copy/paste the code). This will also work, unless the combo box
> also runs its own pump while the drop down window is down :-)
>
> And I'm sure there are other ideas...
>
> --
> Cosmin Prund
>
>   

_______________________________________________
Delphi mailing list -> [email protected]
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Reply via email to