/// <summary>
        /// Constructor takes the input handler to use and an enumearble over the layer keys in order that they should be processed
        /// </summary>
        /// <param name="inputHandler">The input handler to use.</param>
        public EventManager(InputHandler inputHandler, IEnumerable layerKeys)
        {
            this.inputHandler = inputHandler;
            keyboard          = new Keyboard();
            keyboardHardware  = inputHandler.createKeyboard(keyboard);
            mouse             = new Mouse(this);
            mouseHardware     = inputHandler.createMouse(mouse);
            touches           = new Touches();
            touchHardware     = inputHandler.createTouchHardware(touches);

            pad1         = new Gamepad(this, GamepadId.Pad1);
            pad2         = new Gamepad(this, GamepadId.Pad2);
            pad3         = new Gamepad(this, GamepadId.Pad3);
            pad4         = new Gamepad(this, GamepadId.Pad4);
            pad1Hardware = inputHandler.createGamepad(pad1);
            pad2Hardware = inputHandler.createGamepad(pad2);
            pad3Hardware = inputHandler.createGamepad(pad3);
            pad4Hardware = inputHandler.createGamepad(pad4);

            foreach (object key in layerKeys)
            {
                eventLayers.Add(key, new EventLayer(this));
            }

            DefaultEvents.registerEventManager(this);
        }
Beispiel #2
0
 /// <summary>
 /// Destroy touch hardware, if you returned null from the create function this will be null.
 /// </summary>
 /// <param name="touches"></param>
 public abstract void destroyTouchHardware(TouchHardware touchHardware);