Join GitHub today
Fix keyPressed for multiple keys #5050
Java2D and FX2D send multiple PRESSED and only one RELEASE event (at
See focusLost() for possible problem when user overrides it and does not call super. It's there only to clear keys when ALT+TAB is pressed so the chance somebody will hit this is low.
Perhaps a HashSet<Long> would be a better fit than an ArrayList<Long> for field pressedKeys here:
Using a Set instead, statement
Due to its hashable searching nature, a Set should be more performant when using methods such as contains(Object) & remove(Object) than a List.