With a GUI that is somewhat similar to the Run dialog design, using an Edit control and a ListBox control, is there a way to capture all user keystrokes while the ListBox is focused, and re-route those back the Edit control (along with re-focusing the Edit control) if the user starts typing?
For navigation keystrokes (up/down arrows for example), it's easy enough to use (or dynamically enable) hotkeys that check which control is active, and take appropriate action (say the top or bottom of the ListBox is focused and I want the next up/down navigation to re-focus the cursor elsewhere--easy to do using Up:: or Down:: with appropriate #If directives)
For alphanumeric keys, is there a way to capture all keystrokes without having hotkeys for all of them? In other words, I would prefer not to have to do something like:
Code: Select all
a::
b::
...
z::
A::
B::
...
Z::
[every typable character]::
doSomething()
Return
Anyone have any clever tricks to capture all keystrokes on the GUI? Or potentially all keystrokes to a particular control (in this case the ListBox). Is it possible to get close to duplicating the keystroke behavior in the Windows run box, which is very similar to this application?