Exemple #1
0
        public override void onInput(InputHandler input)
        {
            if (rebindTime < 0)
            {
                base.onInput(input);
            }
            else
            {
                switch (input.activeInput)
                {
                case InputHandler.ActiveInput.Keyboard:
                {
                    Keys[] pressedKeys = input.getPressedKeys();
                    if (pressedKeys.Length > 0)
                    {
                        InputBindings.setKeyboardBinds(rebind, pressedKeys[0]);
                        rebindTime = -1;
                        setStrings(buildStrings(-1));
                    }
                    break;
                }

                case InputHandler.ActiveInput.Gamepad:
                {
                    Buttons[] pressedButtons = input.getPressedButtons(0);
                    if (pressedButtons.Length > 0)
                    {
                        InputBindings.setGamepadBinds(rebind, pressedButtons[0]);
                        rebindTime = -1;
                        setStrings(buildStrings(-1));
                    }
                    break;
                }
                }
            }
        }