mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 20:39:01 +00:00
* Added the German keyboard layout and made the keyboard implementation more scalable and modular to permit future foreign keyboards. * Added support for ALTGR-keypresses * Added support for the OEM-102-key * Cleaned up some code
92 lines
No EOL
3.9 KiB
C#
92 lines
No EOL
3.9 KiB
C#
namespace Cosmos.HAL
|
|
{
|
|
public class KeyMapping
|
|
{
|
|
public uint Scancode;
|
|
public char Value;
|
|
public char Shift;
|
|
public char Num;
|
|
public char Caps;
|
|
public char ShiftCaps;
|
|
public char ShiftNum;
|
|
public char Control;
|
|
public char ControlAlt;
|
|
public char ControlShift;
|
|
public char ControlAltShift;
|
|
public ConsoleKeyEx Key;
|
|
public ConsoleKeyEx NumLockKey;
|
|
|
|
public KeyMapping(uint 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;
|
|
}
|
|
|
|
public KeyMapping(uint 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)
|
|
{
|
|
}
|
|
|
|
public KeyMapping(uint 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)
|
|
{
|
|
}
|
|
|
|
public KeyMapping(uint 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)
|
|
{
|
|
}
|
|
|
|
public KeyMapping(uint 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)
|
|
{
|
|
}
|
|
|
|
public KeyMapping(uint 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)
|
|
{
|
|
}
|
|
|
|
public KeyMapping(uint 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)
|
|
{
|
|
}
|
|
|
|
public KeyMapping(uint 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)
|
|
{
|
|
}
|
|
|
|
public KeyMapping(uint 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)
|
|
{
|
|
}
|
|
|
|
public KeyMapping(uint aScanCode, char num, ConsoleKeyEx aKey, ConsoleKeyEx numKey)
|
|
: this(aScanCode, '\0', '\0', num, '\0', '\0', '\0', aKey, numKey)
|
|
{
|
|
}
|
|
|
|
public KeyMapping(uint aScanCode, char n, ConsoleKeyEx aKey)
|
|
: this(aScanCode, n, n, n, n, n, n, aKey)
|
|
{
|
|
}
|
|
|
|
public KeyMapping(uint aScanCode, ConsoleKeyEx aKey)
|
|
: this(aScanCode, '\0', '\0', '\0', '\0', '\0', '\0', aKey)
|
|
{
|
|
}
|
|
}
|
|
} |