Esempio n. 1
0
        private void TellMouse(InputListener listener)
        {
            foreach (var button in MappedMouseButtons)
            {
                if (MouseButtonsPressed[button])
                    listener.DoMouseButtonPressed(Player, button);

                if (MouseButtonsPressedOnce[button])
                    listener.DoMouseButtonPressedOnce(Player, button);

                if (MouseButtonsReleased[button])
                    listener.DoMouseButtonReleased(Player, button);
            }


            if (MouseScrolled != 0)
                listener.DoMouseScrolled(Player, MouseScrolled);


            if (MouseMoved != Vector3.Zero)
                listener.DoMouseMoved(Player, MouseMoved);


            foreach (var keyboardkey in MappedKeys)
            {
                if (KeysPressed[keyboardkey])
                    listener.DoKeyPressed(Player, keyboardkey);

                if (KeysPressedOnce[keyboardkey])
                    listener.DoKeyPressedOnce(Player, keyboardkey);

                if (KeysReleased[keyboardkey])
                    listener.DoKeyReleased(Player, keyboardkey);
            }
        }