public static bool isKeyOverride(Keyboard.Key key) { if (PressedKeys.Contains(key.ToString()) && !OldPressedKeys.Contains(key.ToString())) return true; return false; }
public static bool isKeyTap(Keyboard.Key key) { if (!isActive) return false; if (PressedKeys.Contains(key.ToString()) && !OldPressedKeys.Contains(key.ToString())) return true; return false; }
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); } } }
/// <summary> /// Initializes a new instance of the <see cref="StaticKeyCodeReference"/> class. /// </summary> /// <param name="key">The key.</param> public StaticKeyCodeReference(Keyboard.Key key) { _key = key; }
public PressListener(Keyboard.Key key) { _key = key; }
/// <summary> /// Adds the given window widget to the main window associated to a shortcut key /// </summary> /// <param name="window">Window to add</param> /// <param name="key">Shorcut key to show and hide the given window</param> public void AddWindow(WindowedWidget window, Keyboard.Key key) { Gui.AddWindow(window, true); Gui.AddKeyWindowBind(key, window); }
/// <summary>returns true, if the key is not pressed this frame and was pressed previous frame</summary> /// <param name="key">Key to be evaluated</param> /// <returns>returns true, if the key is not pressed this frame and was pressed previous frame</returns> public static bool upward(Keyboard.Key key) { if (!isInitialized) { initialize(); } return previousKeyIsPressed[(int)key] && !currentKeyIsPressed[(int)key]; }
public static bool isPressed(Keyboard.Key key) { return currentKeyIsPressed[(int)key]; }
public KeyEvent(KeyStateChange type_, Keyboard.Key key_) : base(EventType.KeyEvent) { StateChange = type_; Key = key_; }
public KeyInputArgs(Keyboard.Key key, bool pressed, bool control, bool shift) { Key = key; Pressed = pressed; Control = control; Shift = shift; }
public static bool isKeyDownOverride(Keyboard.Key key) { return Keyboard.IsKeyPressed(key); }
public virtual bool KeyPressed(Keyboard.Key key, string text) { return false; }
public bool IsKeyPressed(Keyboard.Key key) { if (pressedKeys.Contains(key)) { pressedKeys.Remove(key); return true; } return false; }
public bool IsKeyHold(Keyboard.Key key) { return pressedKeys.Contains(key); }
/// <summary> /// Changes the referened key. /// </summary> /// <param name="newValue">The new <see cref="Keyboard.Key"/>.</param> public void ChangeKey(Keyboard.Key newValue) { _key = newValue; }
public static bool IsKeyPressed(Keyboard.Key key) => KeysPressed.Contains(key);
public static bool isKeyUp(Keyboard.Key key) { if (!isActive) return false; return !Keyboard.IsKeyPressed(key); }
public override bool KeyPressed(Keyboard.Key key, string text) { if (_focus == null) return false; return _focus.KeyPressed(key, text); }
public KeyCombinationEvent(bool ctrl_, bool shift_, Keyboard.Key key_) : base(EventType.KeyCombinationEvent) { Ctrl = ctrl_; Shift = shift_; Key = key_; }