• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Keyboard input: only 3 keys at a time

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 121
12
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
a wee bit from the empire
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic