108 lines
2.6 KiB
C#
108 lines
2.6 KiB
C#
using System;
|
|
|
|
namespace OpenMacroBoard.SDK {
|
|
/// <summary>
|
|
/// An event argument that is used to communicate key state changes.
|
|
/// </summary>
|
|
public class KeyEventArgs : EventArgs {
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="KeyEventArgs"/> class.
|
|
/// </summary>
|
|
/// <param name="key">The index of the key that was pressed or released.</param>
|
|
/// <param name="isDown">A flag that determines if the key was pressed or released.</param>
|
|
public KeyEventArgs(Int32 key, Boolean isDown) {
|
|
this.Key = key;
|
|
this.IsDown = isDown;
|
|
}
|
|
|
|
/// <summary>
|
|
/// The index of the key that was pressed or released.
|
|
/// </summary>
|
|
public Int32 Key {
|
|
get;
|
|
}
|
|
|
|
/// <summary>
|
|
/// A flag that determines if the key was pressed or released.
|
|
/// </summary>
|
|
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;
|
|
}
|
|
}
|