|
Polled keyboard input through swing
Hello!
A new member here, with a question I have wanted to know the answer to for absolutely ages, and have never found a solution to...
Is is possible to setup a swing form to handle polled keyboard input. By this, I mean overridding the event model for keyboard input, and instead invoke some "getch()" style method.
For the current project I have in mind (a game) it is not desirable to for the usual event behavior of keyboard input, (eg keyTyped(), keyPressed(), keyReleased()).
Instead, I require a method which can be invoked, block execution and then return the keypress. Im not even sure this can be acheived... Any ideas?
|