using UnityEngine; namespace FairyGUI { /// /// /// public class InputEvent { /// /// x position in stage coordinates. /// public float x { get; internal set; } /// /// y position in stage coordinates. /// public float y { get; internal set; } /// /// /// public KeyCode keyCode { get; internal set; } /// /// /// public char character { get; internal set; } /// /// /// public EventModifiers modifiers { get; internal set; } /// /// /// public int mouseWheelDelta { get; internal set; } /// /// /// public int touchId { get; internal set; } /// /// -1-none,0-left,1-right,2-middle /// public int button { get; internal set; } internal int clickCount; internal static bool shiftDown; public InputEvent() { touchId = -1; x = 0; y = 0; clickCount = 0; keyCode = KeyCode.None; character = '\0'; modifiers = 0; mouseWheelDelta = 0; } /// /// /// public Vector2 position { get { return new Vector2(x, y); } } /// /// /// public bool isDoubleClick { get { return clickCount > 1; } } /// /// /// public bool ctrl { get { RuntimePlatform rp = Application.platform; bool isMac = ( rp == RuntimePlatform.OSXEditor || rp == RuntimePlatform.OSXPlayer); return isMac ? ((modifiers & EventModifiers.Command) != 0) : ((modifiers & EventModifiers.Control) != 0); } } /// /// /// public bool shift { get { //return (modifiers & EventModifiers.Shift) != 0; return shiftDown; } } /// /// /// public bool alt { get { return (modifiers & EventModifiers.Alt) != 0; } } } }