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

Author Topic: Seeing a key is pressed  (Read 2049 times)

0 Members and 1 Guest are viewing this topic.

Xyro

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Seeing a key is pressed
« on: January 06, 2011, 05:16:46 pm »
How can I go an see if a key is being pressed, I only found this in a sample :

Code: [Select]

        void OnKeyPressed(object sender, KeyEventArgs e)
        {
            RenderWindow window = (RenderWindow)sender;
            if (e.Code == KeyCode.Escape)
                window.Close();
        }


but this only works for one key at a time and I want to get multiple keys.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Seeing a key is pressed
« Reply #1 on: January 06, 2011, 05:31:02 pm »
Don't know if DotNet got that class, but you should have a look at the Input class.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Seeing a key is pressed
« Reply #2 on: January 06, 2011, 06:07:56 pm »
Code: [Select]
window.Input.IsKeyPressed(...)
Laurent Gomila - SFML developer

 

anything