using System; namespace OpenMacroBoard.SDK { /// /// An event argument that is used to communicate key state changes. /// public class KeyEventArgs : EventArgs { /// /// Initializes a new instance of the class. /// /// The index of the key that was pressed or released. /// A flag that determines if the key was pressed or released. public KeyEventArgs(Int32 key, Boolean isDown) { this.Key = key; this.IsDown = isDown; } /// /// The index of the key that was pressed or released. /// public Int32 Key { get; } /// /// A flag that determines if the key was pressed or released. /// public Boolean IsDown { get; } } public class KeyPressEvent : EventArgs { public KeyPressEvent(Int32 key) => this.Key = key; public Int32 Key { get; } public override String ToString() => "Key: " + this.Key; } public class TouchTipEvent : EventArgs { public TouchTipEvent(UInt16 x, UInt16 y) { this.XCoord = x; this.YCoord = y; } public UInt16 XCoord { get; } public UInt16 YCoord { get; } public override String ToString() => "X-Coord: " + this.XCoord + ", Y-Coord: " + this.YCoord; } public class TouchFlipEvent : EventArgs { public TouchFlipEvent(UInt16 fx, UInt16 fy, UInt16 tx, UInt16 ty) { this.FromXCoord = fx; this.FromYCoord = fy; this.ToXCoord = tx; this.ToYCoord = ty; } public UInt16 FromXCoord { get; } public UInt16 FromYCoord { get; } public UInt16 ToXCoord { get; } public UInt16 ToYCoord { get; } public override String ToString() => "From X-Coord: " + this.FromXCoord + ", Y-Coord: " + this.FromYCoord+ ", To X-Coord: " + this.ToXCoord + ", Y-Coord: " + this.ToYCoord; } public class KnobPressEvent : EventArgs { public KnobPressEvent(Int32 key) => this.Encoder = key; public Int32 Encoder { get; } public override String ToString() => "Encoder: " + this.Encoder; } public class KnobTurnEvent : EventArgs { public KnobTurnEvent(Int32 key, SByte steps) { this.Encoder = key; this.Steps = steps; } public Int32 Encoder { get; } public SByte Steps { get; } public override String ToString() => "Encoder: " + this.Encoder + ", Steps: " + this.Steps; } }