Exemplo n.º 1
0
        public BindingsHandler(MouseHandler mouseHandler, KeyboardHandler keyboardHandler, GamePadHandler gamePadHandler)
        {
            this.mouseHandler = mouseHandler;
            this.keyboardHandler = keyboardHandler;
            this.gamePadHandler = gamePadHandler;

            Binding = new Dictionary<int, InputState>();
            keyboardBindings = new Dictionary<int, List<Keys>>();
            mouseBindings = new Dictionary<int, List<MouseInputType>>();
            gamePadBindings = new Dictionary<int, List<Buttons>>();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public InputContext(GameContext context)
        {
            // Initialize the mouse
            Mouse = new MouseHandler(context);

            // Initialize the keyboard
            Keyboard = new KeyboardHandler(context);

            // Initialize the gamepad
            GamePad = new GamePadHandler();

            // Initialize the bindings handler
            Bindings = new BindingsHandler(Mouse, Keyboard, GamePad);
        }