/// <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); }
/// <summary> /// Destroys the given mouse. The mouse will be disposed after this function /// call and you will no longer be able to use it. /// </summary> /// <param name="mouse">The mouse to destroy.</param> public abstract void destroyMouse(MouseHardware mouse);