VB listen for arrow keys
Posted on 2005-03-07
I have a mature fielded application that i am trying to retrofit. I need to listen for the Left and Right arrow keys fro the keyboard.
The software is a presentation tool and there are several forms or containers playing differnt media formats. When I set keypreview to the master form and try to use the built in keydown or keypress subs they do not always have focu and in most cases never get the message anyway. There is also an optional topmost floating toolbar to interfere with focus.
I have a timer running at 200ms to listen for the mouse curssor hitting an edge where i produce a pop up menu.
Ideally there would be some way to read the keyboard buffer in the timer sub, decide if i need to take a Previous or Next action and flush the keyboard buffer.