I am trying to sense multiple keys at a time and I am wondering how to use a hash map to do this.
sirlink99 56 Practically a Master Poster
Recommended Answers
Jump to PostYou'll probably need to use keypressed and keyreleased.
When keypressed fires, if the firing key is "CTRL" set a flag, controlDown, to true
When keyreleased fires, if the firing key is "CTRL", set that flag to falseIf keypressed fires, and the firing key is "SPACE", check that …
Jump to PostYou have been on DaniWeb long enough to know that "It doesn't seem to work" isn't good enough.
If you want someone to help, please give a proper description of your problem and the things you have already done to try to solve it.
Jump to PostHave you put print statements into your code to confirm whether the right things are being called? Don't try to guess that kind of thing - test whether it's right.
Did you remember to add the KeyListener to the relevant components??
All 12 Replies
jon.kiparsky 326 Posting Virtuoso
sirlink99 56 Practically a Master Poster
mKorbel 274 Veteran Poster
jon.kiparsky 326 Posting Virtuoso
sirlink99 56 Practically a Master Poster
jon.kiparsky 326 Posting Virtuoso
sirlink99 56 Practically a Master Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
sirlink99 56 Practically a Master Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
sirlink99 56 Practically a Master Poster
mKorbel 274 Veteran Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.