public void init() { keyMoveForward = new KeyBind(this, Key.W); keyMoveBackward = new KeyBind(this, Key.S); keyMoveLeft = new KeyBind(this, Key.A); keyMoveRight = new KeyBind(this, Key.D); keyRotateLeft = new KeyBind(this, Key.Q); keyRotateRight = new KeyBind(this, Key.E); keyRotateUp = new KeyBind(this, Key.R); keyRotateDown = new KeyBind(this, Key.F); keyAttack = new KeyBind(this, Key.Space); leftClick = new KeyBind(this, MouseButton.Left); rightClick = new KeyBind(this, MouseButton.Right); keyEscape = new KeyBind(this, Key.Escape); }
private bool isKeyDown(KeyBind keyBind, Game game) { return game.Focused ? (keyBind.isKey ? keyboardState.IsKeyDown(keyBind.kId) : mouseState.IsButtonDown(keyBind.mbId)) : false; }
public void Add(KeyBind keyBind) { keyBindList.Add(keyBind); }