Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Keyboard input: only 3 keys at a time

 
Jasper Simon
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(I am fairly new to the java language and its terminology and forum habits...)

As the title says, I have some keyboard input issues.
I have two EventFilters on the scene of some sort of Minigame, where users have to hold their respective key for the longest time.

The first EventFilter works on the KeyPressed event, and sets a boolean corresponding to that player's key to true (meaning that their key is pressed).
The second EventFilter uses the KeyReleased event. It sets that same boolean value to false (meaning that the key has been released).

Everything works fine with 2 people.
Now, when more than 3 people play, everything works until 3 keys are held down at the same time. Then a 4th key being pressed does not start an EventHandler.

Anyone knows if this is a limitation of javaFX?
 
Maxim Karvonen
Ranch Hand
Posts: 121
12
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Jasper

It's not a JavaFX limitation. It is a hardware limitation. Most keyboards do not support 4 simultaneous keypresses. Some of them do not support even some 3-key combinations.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic