SFML community forums

Bindings - other languages => DotNet => Topic started by: Xyro on January 06, 2011, 05:16:46 pm

Title: Seeing a key is pressed
Post by: Xyro 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.
Title: Seeing a key is pressed
Post by: Groogy 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.
Title: Seeing a key is pressed
Post by: Laurent on January 06, 2011, 06:07:56 pm
Code: [Select]
window.Input.IsKeyPressed(...)