Results 1 to 3 of 3
- 02-04-2008, 01:05 AM #1
Member
- Join Date
- Feb 2008
- Posts
- 2
- Rep Power
- 0
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?
- 02-04-2008, 12:20 PM #2
Member
- Join Date
- Jan 2008
- Posts
- 6
- Rep Power
- 0
to start with U can use a thread !
- 02-04-2008, 04:05 PM #3
Member
- Join Date
- Feb 2008
- Posts
- 2
- Rep Power
- 0
Okay, well I have only used threads in a limited capacity so far. Mostly for network client/server implementations. How would I go about this? Im good with most of the Java programming features, but threads are not my strong point (lack of practice). Some pseudocode would be helpful. Im not looking for a coded solution, just a nudge in the right direction!
Thanks
Similar Threads
-
getting each character from keyboard
By Sreejesh25 in forum New To JavaReplies: 11Last Post: 01-25-2011, 01:08 PM -
getting each character from keyboard
By Sreejesh25 in forum Advanced JavaReplies: 6Last Post: 03-05-2010, 07:12 PM -
Assign a keyboard key to a JButton.
By gszauer in forum AWT / SwingReplies: 1Last Post: 12-15-2007, 10:42 PM -
Help with keyboard events?
By Bibendum in forum New To JavaReplies: 2Last Post: 11-02-2007, 02:51 AM -
how to take input and verify input in Java programs
By bilal_ali_java in forum Advanced JavaReplies: 0Last Post: 07-21-2007, 08:46 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks