Removing Input tab as we don't need to specific features anymore.
2 using System.Collections.Generic;
4 using System.Reflection;
6 using System.Threading.Tasks;
7 using System.Runtime.Serialization;
8 using System.Windows.Forms;
9 using Ear = SharpLib.Ear;
10 using Hid = SharpLib.Hid;
12 namespace SharpDisplayManager
15 [Ear.AttributeObject(Id = "Event.Hid", Name = "HID", Description = "Corresponding HID message received.")]
16 public class EventHid: Ear.Event
23 public ushort UsagePage { get; set; }
26 public ushort UsageCollection { get; set; }
29 public ushort Usage { get; set; }
32 public Keys Key { get; set; }
35 [Ear.AttributeObjectProperty
37 Id = "HID.Keyboard.IsKeyUp",
39 Description = "Key up if set, key down otherwise."
41 public bool IsKeyUp { get; set; } = false;
44 public bool IsMouse { get; set; }
47 public bool IsKeyboard { get; set; }
50 public bool IsGeneric { get; set; }
53 public bool HasModifierShift { get; set; } = false;
56 public bool HasModifierControl { get; set; } = false;
59 public bool HasModifierAlt { get; set; } = false;
62 public bool HasModifierWindows { get; set; } = false;
65 protected override void DoConstruct()
68 UpdateDynamicProperties();
71 private void UpdateDynamicProperties()
78 /// Make sure we distinguish between various configuration of this event
80 /// <returns></returns>
81 public override string Brief()
83 string brief = Name + ": ";
87 brief += Key.ToString();
94 if (HasModifierControl)
104 if (HasModifierWindows)
129 /// <param name="obj"></param>
130 /// <returns></returns>
131 public override bool Equals(object obj)
133 if (obj is EventHidKeyboard)
135 EventHidKeyboard e = (EventHidKeyboard)obj;
137 && e.IsKeyUp == IsKeyUp
138 && e.HasModifierAlt == HasModifierAlt
139 && e.HasModifierControl == HasModifierControl
140 && e.HasModifierShift == HasModifierShift
141 && e.HasModifierWindows == HasModifierWindows;