Пример #1
0
 public static void Clear(ref KeyboardInput input)
 {
     input.Held.Clear();
     input.Pressed.Clear();
     input.Released.Clear();
     input.Shift = false;
     input.Alt = false;
     input.Ctrl = false;
 }
Пример #2
0
 internal Keyboard(DKeyboard keyboard)
 {
     System.Diagnostics.Debug.Assert(keyboard != null);
     _dKeyboard = keyboard;
     _inputState = KeyboardInput.CreateEmpty();
     _lastPressedKeys = new List<Key>();
     (_timer = new GameTimer()).Start();
     _currentDirectInputState = new KeyboardState();
 }
Пример #3
0
 public static KeyboardInput CreateEmpty()
 {
     var keys = new KeyboardInput();
     keys.Held = new List<Key>();
     keys.Pressed = new List<Key>();
     keys.Released = new List<Key>();
     keys.Shift = false;
     keys.Alt = false;
     keys.Ctrl = false;
     return keys;
 }