Results 1 to 4 of 4
- 12-29-2010, 06:54 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 2
- Rep Power
- 0
Handling input - multiple keys pressed
Hey,
at the moment I'm working on a little Game-Framework for Processing (Processing is a small graphics-orientated language based on java). My first problem is handling kayboard input: the given functions keyPressed() and keyReleased() do only give information about the last key that was pressed. so now i have to write my own functions based on the java-API. i had the idea to use the keyListener-functions but they only can handle a single input, just like the processing functions. I searched google and a few forums about gameprogramming but noone was able to help me... so if you have some ideas please let me know
shadowstrike
- 12-29-2010, 07:21 PM #2
You haven't actually told us what your problem or question is.
But to practice my mind-reading, I'd say you want to store the "key-down-ness" of the keys in question as a boolean, then check those booleans and perform the appropriate action in a Timer.How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 12-29-2010, 07:43 PM #3
Member
- Join Date
- Dec 2010
- Posts
- 2
- Rep Power
- 0
ok sorry xD
so i want to write functions to handle keyboard input. the functions should be able to handle multiple pressed keys (so for example: a and x are pressed). The problem about that is that i don't know a way to do. google didn't help and the forums i searched didn't as well
- 12-30-2010, 01:47 PM #4
Are you trying to determine when you should do two things at once (a does one thing and x does another, and you want to do both of them when both keys are pressed), or do you want to do one thing when the keys are pressed "at the same time"?
What happened when you tried my suggestion?How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
Similar Threads
-
Handling multiple WAV files and saving them into ONE
By phil128 in forum Advanced JavaReplies: 2Last Post: 12-11-2010, 02:31 PM -
Checking for multiple keys pressed
By MagnusLarsen in forum New To JavaReplies: 15Last Post: 08-22-2010, 11:51 AM -
Handling Errors IE: Wrong User Input
By movsesinator in forum New To JavaReplies: 4Last Post: 04-06-2010, 01:37 AM -
data structure with multiple keys
By jon80 in forum New To JavaReplies: 2Last Post: 06-13-2009, 03:02 PM -
Runtime.exec(), handling input and output streams
By crookshank in forum New To JavaReplies: 0Last Post: 06-05-2008, 02:41 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks