SFML community forums

Bindings - other languages => Java => Topic started by: 7krs on January 19, 2014, 05:59:02 am

Title: Handling Individual Keys
Post by: 7krs on January 19, 2014, 05:59:02 am
Edit2: figured it out:

 ...KeyEvent keyev = event.asKeyEvent();
                                        switch (keyev.key)
                                                case B: ...

Edit: I found it here http://jsfml.org/javadoc/org/jsfml/window/Keyboard.Key.html, but I still wonder how I can use it in a switch.

I was reading the input section, and I've been reading some of the Javadocs on input handling. I am looking for key-specific input handling as implemented in SFML.

The examples (here: https://github.com/pdinklag/JSFML/wiki/Input) print out the name of an individual key; but how can I construct a switch-case structure to check for individual keys coming from KEY_PRESSED events?