Tidy IInputHandler.

This commit is contained in:
Paul Chote
2013-10-30 18:12:49 +13:00
parent 5722d2226a
commit ae8475620d

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information #region Copyright & License Information
/* /*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS) * Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made * This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License * available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information, * as published by the Free Software Foundation. For more information,
@@ -16,11 +16,12 @@ namespace OpenRA
{ {
public interface IInputHandler public interface IInputHandler
{ {
void ModifierKeys( Modifiers mods ); void ModifierKeys(Modifiers mods);
void OnKeyInput( KeyInput input ); void OnKeyInput(KeyInput input);
void OnMouseInput( MouseInput input ); void OnMouseInput(MouseInput input);
} }
public enum MouseInputEvent { Down, Move, Up }
public struct MouseInput public struct MouseInput
{ {
public MouseInputEvent Event; public MouseInputEvent Event;
@@ -29,18 +30,16 @@ namespace OpenRA
public Modifiers Modifiers; public Modifiers Modifiers;
public int MultiTapCount; public int MultiTapCount;
public MouseInput( MouseInputEvent ev, MouseButton button, int2 location, Modifiers mods, int multiTapCount ) public MouseInput(MouseInputEvent ev, MouseButton button, int2 location, Modifiers mods, int multiTapCount)
{ {
this.Event = ev; Event = ev;
this.Button = button; Button = button;
this.Location = location; Location = location;
this.Modifiers = mods; Modifiers = mods;
this.MultiTapCount = multiTapCount; MultiTapCount = multiTapCount;
} }
} }
public enum MouseInputEvent { Down, Move, Up };
[Flags] [Flags]
public enum MouseButton public enum MouseButton
{ {
@@ -62,7 +61,7 @@ namespace OpenRA
Meta = 8, Meta = 8,
} }
public enum KeyInputEvent { Down, Up }; public enum KeyInputEvent { Down, Up }
public struct KeyInput public struct KeyInput
{ {
public KeyInputEvent Event; public KeyInputEvent Event;