Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
        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;
        }