SFML.Window.Keyboard.IsKeyPressed C# (CSharp) Method

IsKeyPressed() public static method

Check if a key is pressed
public static IsKeyPressed ( Key key ) : bool
key Key Key to check
return bool
        public static bool IsKeyPressed(Key key)
        {
            return sfKeyboard_isKeyPressed(key);
        }

Usage Example

Beispiel #1
0
 private void Handler_AddMapping_OnKeyboardKeyDown(object sender, KeyEventArgs e)
 {
     foreach (Keyboard.Key key in Enum.GetValues(typeof(Keyboard.Key)).Cast <Keyboard.Key>())
     {
         if (Keyboard.IsKeyPressed(key))
         {
             Handler_AddMapping_GenericKeyDown(ExtraButtons.Unknown, key, MouseButton.Unknown);
         }
     }
 }