Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Handling Individual Keys  (Read 5389 times)

0 Members and 2 Guests are viewing this topic.

7krs

  • Newbie
  • *
  • Posts: 39
    • View Profile
    • Email
Handling Individual Keys
« 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?
« Last Edit: January 19, 2014, 06:19:26 am by 7krs »