namespace Cosmos.System
{
///
/// KeyMapping class. Used to map keyboard.
///
public class KeyMapping
{
///
/// Scan code.
///
public byte Scancode;
///
/// Value.
///
public char Value;
///
/// Shift.
///
public char Shift;
///
/// Num.
///
public char Num;
///
/// Caps.
///
public char Caps;
///
/// Shift and Caps.
///
public char ShiftCaps;
///
/// Shift and Num.
///
public char ShiftNum;
///
/// Ctrl.
///
public char Control;
///
/// Ctrl and Alt.
///
public char ControlAlt;
///
/// Ctrl and Shift.
///
public char ControlShift;
///
/// Ctrl, Alt and Shift.
///
public char ControlAltShift;
///
/// Key.
///
public ConsoleKeyEx Key;
///
/// NumLock key.
///
public ConsoleKeyEx NumLockKey;
///
/// Create new instance of the class.
///
/// A scan code.
/// Norm.
/// Shift.
/// Num.
/// Caps.
/// Shift and Caps.
/// Shift and Num
/// Ctrl and Alt.
/// Ctrl, Alt and Shift.
/// Ctrl.
/// Shift and Ctrl.
/// A key.
/// NumLock key.
public KeyMapping(byte aScanCode, char norm, char shift, char num, char caps, char shiftcaps, char shiftnum, char altgr, char shiftaltgr, char ctrl, char shiftctrl, ConsoleKeyEx aKey, ConsoleKeyEx numKey)
{
Scancode = aScanCode;
Value = norm;
Shift = shift;
Num = num;
Caps = caps;
ShiftCaps = shiftcaps;
ShiftNum = shiftnum;
Key = aKey;
NumLockKey = aKey;
ControlAlt = altgr;
Control = ctrl;
ControlAltShift = shiftaltgr;
ControlShift = shiftctrl;
NumLockKey = numKey;
}
///
/// Create new instance of the class.
///
/// A scan code.
/// Norm.
/// Shift.
/// Num.
/// Caps.
/// Shift and Caps.
/// Shift and Num
/// Ctrl and Alt.
/// Ctrl, Alt and Shift.
/// A key.
/// NumLock key.
public KeyMapping(byte aScanCode, char norm, char shift, char num, char caps, char shiftcaps, char shiftnum, char altgr, char shiftaltgr, ConsoleKeyEx aKey, ConsoleKeyEx numKey)
: this(aScanCode, norm, shift, num, caps, shiftcaps, shiftnum, altgr, shiftaltgr, '\0', '\0', aKey, numKey)
{
}
///
/// Create new instance of the class.
///
/// A scan code.
/// Norm.
/// Shift.
/// Num.
/// Caps.
/// Shift and Caps.
/// Shift and Num
/// Ctrl and Alt.
/// A key.
/// NumLock key.
public KeyMapping(byte aScanCode, char norm, char shift, char num, char caps, char shiftcaps, char shiftnum, char altgr, ConsoleKeyEx aKey, ConsoleKeyEx numKey)
: this(aScanCode, norm, shift, num, caps, shiftcaps, shiftnum, altgr, '\0', '\0', '\0', aKey, numKey)
{
}
///
/// Create new instance of the class.
///
/// A scan code.
/// Norm.
/// Shift.
/// Num.
/// Caps.
/// Shift and Caps.
/// Shift and Num
/// Ctrl and Alt.
/// Ctrl, Alt and Shift.
/// Ctrl.
/// Shift and Ctrl.
/// A key.
public KeyMapping(byte aScanCode, char norm, char shift, char num, char caps, char shiftcaps, char shiftnum, char altgr, char shiftaltgr, char ctrl, char shiftctrl, ConsoleKeyEx aKey)
: this(aScanCode, norm, shift, num, caps, shiftcaps, shiftnum, altgr, shiftaltgr, ctrl, shiftctrl, aKey, aKey)
{
}
///
/// Create new instance of the class.
///
/// A scan code.
/// Norm.
/// Shift.
/// Num.
/// Caps.
/// Shift and Caps.
/// Shift and Num
/// Ctrl and Alt.
/// Ctrl, Alt and Shift.
/// A key.
public KeyMapping(byte aScanCode, char norm, char shift, char num, char caps, char shiftcaps, char shiftnum, char altgr, char shiftaltgr, ConsoleKeyEx aKey)
: this(aScanCode, norm, shift, num, caps, shiftcaps, shiftnum, altgr, shiftaltgr, '\0', '\0', aKey)
{
}
///
/// Create new instance of the class.
///
/// A scan code.
/// Norm.
/// Shift.
/// Num.
/// Caps.
/// Shift and Caps.
/// Shift and Num
/// Ctrl and Alt.
/// A key.
public KeyMapping(byte aScanCode, char norm, char shift, char num, char caps, char shiftcaps, char shiftnum, char altgr, ConsoleKeyEx aKey)
: this(aScanCode, norm, shift, num, caps, shiftcaps, shiftnum, altgr, '\0', '\0', '\0', aKey)
{
}
///
/// Create new instance of the class.
///
/// A scan code.
/// Norm.
/// Shift.
/// Num.
/// Caps.
/// Shift and Caps.
/// Shift and Num
/// A key.
public KeyMapping(byte aScanCode, char norm, char shift, char num, char caps, char shiftcaps, char shiftnum, ConsoleKeyEx aKey)
: this(aScanCode, norm, shift, num, caps, shiftcaps, shiftnum, '\0', '\0', '\0', '\0', aKey)
{
}
///
/// Create new instance of the class.
///
/// A scan code.
/// Norm.
/// Shift.
/// Num.
/// Caps.
/// Shift and Caps.
/// Shift and Num
/// A key.
/// NumLock key.
public KeyMapping(byte aScanCode, char norm, char shift, char num, char caps, char shiftcaps, char shiftnum, ConsoleKeyEx aKey, ConsoleKeyEx numKey)
: this(aScanCode, norm, shift, num, caps, shiftcaps, shiftnum, '\0', aKey, numKey)
{
}
///
/// Create new instance of the class.
///
/// A scan code.
/// Norm.
/// Shift.
/// Num.
/// Caps.
/// Shift and Caps.
/// Shift and Num
/// A key.
public KeyMapping(byte aScanCode, int norm, int shift, int num, int caps, int shiftcaps, int shiftnum, ConsoleKeyEx aKey)
: this(aScanCode, (char)norm, (char)shift, (char)num, (char)caps, (char)shiftcaps, (char)shiftnum, aKey)
{
}
///
/// Create new instance of the class.
///
/// A scan code.
/// Num.
/// A key.
/// NumLock key.
public KeyMapping(byte aScanCode, char num, ConsoleKeyEx aKey, ConsoleKeyEx numKey)
: this(aScanCode, '\0', '\0', num, '\0', '\0', '\0', aKey, numKey)
{
}
///
/// Create new instance of the class.
///
/// A scan code.
/// All control keys char.
/// A key.
public KeyMapping(byte aScanCode, char n, ConsoleKeyEx aKey)
: this(aScanCode, n, n, n, n, n, n, aKey)
{
}
///
/// Create new instance of the class.
///
/// A scan code.
/// A key.
public KeyMapping(byte aScanCode, ConsoleKeyEx aKey)
: this(aScanCode, '\0', '\0', '\0', '\0', '\0', '\0', aKey)
{
}
}
}