public static bool IsDown(ref KeyboardState kb, PixelGlueButtons key) { if (UserKeybinds.GenericToKeybinds.TryGetValue(key, out var realKey)) { return(kb.IsKeyDown(realKey.defaultBind) || kb.IsKeyDown(realKey.userBind)); } return(false); }
public static bool IsPressed(ref KeyboardComponent component, PixelGlueButtons key) { if (UserKeybinds.GenericToKeybinds.TryGetValue(key, out var realKey)) { for (int i = 0; i < component.OldButtons?.Count; i++) { if (component.OldButtons[i] == key) { return(false); } } return(Keyboard.GetState().IsKeyDown(realKey.userBind) || Keyboard.GetState().IsKeyDown(realKey.defaultBind)); } return(false); }
public bool IsDown(PixelGlueButtons btn) => Buttons.Contains(btn);
public bool IsUp(PixelGlueButtons btn) => !Buttons.Contains(btn);
public bool IsPressed(PixelGlueButtons btn) => Buttons.Contains(btn) && !OldButtons.Contains(btn);