Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic