Compare commits
3 Commits
d20d929515
...
dashboard2
| Author | SHA1 | Date | |
|---|---|---|---|
| 5bcc2d8214 | |||
| 804a3979fd | |||
| d299084db5 |
@@ -155,6 +155,10 @@ namespace Dashboard.BlurgText
|
||||
protected BlurgFontProxy InternFont(IFont font)
|
||||
{
|
||||
BlurgTextExtension appExtension = Application.ExtensionRequire<BlurgTextExtension>();
|
||||
|
||||
if (font is Font xfont)
|
||||
font = xfont.Base;
|
||||
|
||||
if (font is FontInfo fontInfo)
|
||||
{
|
||||
return (BlurgFontProxy)appExtension.Load(fontInfo);
|
||||
|
||||
@@ -34,25 +34,161 @@ namespace Dashboard.Events
|
||||
|
||||
public enum ScanCode
|
||||
{
|
||||
// TODO: this array is from ReFuel, see if this makes any sense.
|
||||
// This scan code table is based on the Win32 scan code table.
|
||||
// See https://learn.microsoft.com/en-us/windows/win32/inputdev/about-keyboard-input
|
||||
Error = 0xFF,
|
||||
SystemPowerDown = 0xE05E,
|
||||
SystemSleep = 0xE05F,
|
||||
SystemWakeUp = 0xE063,
|
||||
|
||||
Esc, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12,
|
||||
Tilde, _1, _2, _3, _4, _5, _6, _7, _8, _9, _0, Minus, Equals, Backspace,
|
||||
Tab, Q, W, E, R, T, Y, U, I, O, P, LBracket, RBracket, Backslash,
|
||||
CapsLock, A, S, D, F, G, H, J, K, L, Semicolon, Quote, Enter,
|
||||
LShift, Z, X, C, V, B, N, M, Dot, Comma, Slash, RShift,
|
||||
LCtrl, LWin, LAlt, Space, RAlt, RWin, Menu, RCtrl,
|
||||
A = 0x1E,
|
||||
B = 0x30,
|
||||
C = 0x2E,
|
||||
D = 0x20,
|
||||
E = 0x12,
|
||||
F = 0x21,
|
||||
G = 0x22,
|
||||
H = 0x23,
|
||||
I = 0x17,
|
||||
J = 0x24,
|
||||
K = 0x25,
|
||||
L = 0x26,
|
||||
M = 0x32,
|
||||
N = 0x31,
|
||||
O = 0x18,
|
||||
P = 0x19,
|
||||
Q = 0x10,
|
||||
R = 0x13,
|
||||
S = 0x1F,
|
||||
T = 0x14,
|
||||
U = 0x16,
|
||||
V = 0x2F,
|
||||
W = 0x11,
|
||||
X = 0x2D,
|
||||
Y = 0x15,
|
||||
Z = 0x2C,
|
||||
|
||||
PrtSc, ScrollLock, PauseBreak,
|
||||
Insert, Delete, Home, End, PgUp, PgDown,
|
||||
Up, Down, Left, Right,
|
||||
D1 = 0x02,
|
||||
D2 = 0x03,
|
||||
D3 = 0x04,
|
||||
D4 = 0x05,
|
||||
D5 = 0x06,
|
||||
D6 = 0x07,
|
||||
D7 = 0x08,
|
||||
D8 = 0x09,
|
||||
D9 = 0x0A,
|
||||
D0 = 0x0B,
|
||||
|
||||
NumLock, NumDiv, NumMul, NumSub, NumAdd, NumEnter, NumDecimal,
|
||||
Num0, Num1, Num2, Num3, Num4, Num5, Num6, Num7, Num8, Num9,
|
||||
|
||||
IsoB00,
|
||||
|
||||
KeysMax,
|
||||
Return = 0x1C,
|
||||
Esc = 0x01,
|
||||
Delete = 0x0E,
|
||||
Tab = 0x0F,
|
||||
Space = 0x39,
|
||||
Dash = 0x0C,
|
||||
Equals = 0x0D,
|
||||
LBracket = 0x1A,
|
||||
RBracket = 0x1B,
|
||||
Backslash = 0x2B,
|
||||
Semicolon = 0x27,
|
||||
Apostrophe = 0x28,
|
||||
Grave = 0x29,
|
||||
Comma = 0x33,
|
||||
Period = 0x34,
|
||||
ForwardSlash = 0x35,
|
||||
CapsLock = 0x3A,
|
||||
F1 = 0x3B,
|
||||
F2 = 0x3C,
|
||||
F3 = 0x3D,
|
||||
F4 = 0x3E,
|
||||
F5 = 0x3F,
|
||||
F6 = 0x40,
|
||||
F7 = 0x41,
|
||||
F8 = 0x42,
|
||||
F9 = 0x43,
|
||||
F10 = 0x44,
|
||||
F11 = 0x45,
|
||||
F12 = 0x46,
|
||||
PrintScr = 0xE037,
|
||||
ScrollLock = 0x46,
|
||||
Pause = 0xE046,
|
||||
Insert = 0xE052,
|
||||
Home = 0xE047,
|
||||
PageUp = 0xE049,
|
||||
Backspace = 0xE053,
|
||||
End = 0xE04F,
|
||||
PageDown = 0xE051,
|
||||
RightArrow = 0xE04D,
|
||||
LeftArrow = 0xE04B,
|
||||
DownArrow = 0xE050,
|
||||
UpArrow = 0xE048,
|
||||
NumLock = 0xE045,
|
||||
NumDiv = 0xE035,
|
||||
NumMul = 0x37,
|
||||
NumSub = 0x4A,
|
||||
NumAdd = 0x4E,
|
||||
NumEnter = 0xE01C,
|
||||
Num1 = 0x4F,
|
||||
Num2 = 0x50,
|
||||
Num3 = 0x51,
|
||||
Num4 = 0x4B,
|
||||
Num5 = 0x4C,
|
||||
Num6 = 0x4D,
|
||||
Num7 = 0x47,
|
||||
Num8 = 0x48,
|
||||
Num9 = 0x49,
|
||||
Num0 = 0x52,
|
||||
NumDecimal = 0x53,
|
||||
NumBackslash = 0x56,
|
||||
NumEquals = 0x59,
|
||||
Application = 0xE05D,
|
||||
F13 = 0x64,
|
||||
F14 = 0x65,
|
||||
F15 = 0x66,
|
||||
F16 = 0x67,
|
||||
F17 = 0x68,
|
||||
F18 = 0x69,
|
||||
F19 = 0x6A,
|
||||
F20 = 0x6B,
|
||||
F21 = 0x6C,
|
||||
F22 = 0x6D,
|
||||
F23 = 0x6E,
|
||||
F24 = 0x76,
|
||||
NumComma = 0x7E,
|
||||
International1 = 0x73,
|
||||
International2 = 0x70,
|
||||
International3 = 0x7D,
|
||||
International4 = 0x79,
|
||||
International5 = 0x7B,
|
||||
International6 = 0x5C,
|
||||
Lang1 = 0x72,
|
||||
Lang2 = 0x71,
|
||||
Lang3 = 0x78,
|
||||
Lang4 = 0x77,
|
||||
LCtrl = 0x1D,
|
||||
LShift = 0x2A,
|
||||
LWin = 0xE05B,
|
||||
LAlt = 0x38,
|
||||
RAlt = 0xE038,
|
||||
RWin = 0xE05C,
|
||||
RCtrl = 0xE01D,
|
||||
RShift = 0x36,
|
||||
NextTrack = 0xE019,
|
||||
PrevTrack = 0xE010,
|
||||
Stop = 0xE024,
|
||||
PlayPause = 0xE022,
|
||||
VolUp = 0xE030,
|
||||
VolDown = 0xE029,
|
||||
Configuration = 0xE06D,
|
||||
Email = 0xE06C,
|
||||
Calculator = 0xE021,
|
||||
Browser = 0xE06B,
|
||||
Search = 0xE065,
|
||||
HomePage = 0xE032,
|
||||
Back = 0xE06A,
|
||||
Forward = 0xE69,
|
||||
Halt = 0xE068,
|
||||
Refresh = 0xE67,
|
||||
Bookmarks = 0xE066,
|
||||
}
|
||||
|
||||
public class KeyboardButtonEventArgs(KeyCode keyCode, ScanCode scanCode, ModifierKeys modifierKeys, bool up)
|
||||
|
||||
@@ -286,6 +286,7 @@ namespace Dashboard.OpenTK.PAL2
|
||||
Scancode.F => ScanCode.F,
|
||||
Scancode.G => ScanCode.G,
|
||||
Scancode.H => ScanCode.H,
|
||||
Scancode.I => ScanCode.I,
|
||||
Scancode.J => ScanCode.J,
|
||||
Scancode.K => ScanCode.K,
|
||||
Scancode.L => ScanCode.L,
|
||||
@@ -303,20 +304,20 @@ namespace Dashboard.OpenTK.PAL2
|
||||
Scancode.X => ScanCode.X,
|
||||
Scancode.Y => ScanCode.Y,
|
||||
Scancode.Z => ScanCode.Z,
|
||||
Scancode.D0 => ScanCode._0,
|
||||
Scancode.D1 => ScanCode._1,
|
||||
Scancode.D2 => ScanCode._2,
|
||||
Scancode.D3 => ScanCode._3,
|
||||
Scancode.D4 => ScanCode._4,
|
||||
Scancode.D5 => ScanCode._5,
|
||||
Scancode.D6 => ScanCode._6,
|
||||
Scancode.D7 => ScanCode._7,
|
||||
Scancode.D8 => ScanCode._8,
|
||||
Scancode.D9 => ScanCode._9,
|
||||
Scancode.UpArrow => ScanCode.Up,
|
||||
Scancode.DownArrow => ScanCode.Down,
|
||||
Scancode.LeftArrow => ScanCode.Left,
|
||||
Scancode.RightArrow => ScanCode.Right,
|
||||
Scancode.D0 => ScanCode.D0,
|
||||
Scancode.D1 => ScanCode.D1,
|
||||
Scancode.D2 => ScanCode.D2,
|
||||
Scancode.D3 => ScanCode.D3,
|
||||
Scancode.D4 => ScanCode.D4,
|
||||
Scancode.D5 => ScanCode.D5,
|
||||
Scancode.D6 => ScanCode.D6,
|
||||
Scancode.D7 => ScanCode.D7,
|
||||
Scancode.D8 => ScanCode.D8,
|
||||
Scancode.D9 => ScanCode.D9,
|
||||
Scancode.UpArrow => ScanCode.UpArrow,
|
||||
Scancode.DownArrow => ScanCode.DownArrow,
|
||||
Scancode.LeftArrow => ScanCode.LeftArrow,
|
||||
Scancode.RightArrow => ScanCode.RightArrow,
|
||||
_ => (ScanCode)0,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user