public InputManager(bool keyRepeat, TimeSpan keyRepeatInterval, bool lefty) { currentInput = previousInput = InputState.GetCurrentState(); nextTextInput = new Dictionary<Keys, TimeSpan>(); EnableKeyRepeat = keyRepeat; RepeatInterval = keyRepeatInterval; RepeatDelay = new TimeSpan(500 * TimeSpan.TicksPerMillisecond); LeftyMode = lefty; }
public void Update(GameTime time) { previousInput = currentInput; currentInput = InputState.GetCurrentState(); currentTime = time.TotalGameTime; if (EnableKeyRepeat) foreach (Keys key in previousInput.Keyboard.GetPressedKeys()) if (KeyReleased(key)) nextTextInput.Remove(key); if (KeyReleased(Keys.CapsLock)) capsLock = !capsLock; }