You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Creates a new instance of the <see cref="Key"/> class.
23
-
/// </summary>
24
-
/// <param name="value">The key value.</param>
25
-
/// <param name="code">The key code of physical key.</param>
26
-
publicKey(stringvalue,stringcode)
16
+
[SuppressMessage("Microsoft.Performance","CA1810:Initialize reference type static fields inline",Justification="Properties are initialized after fields")]
17
+
staticKey()
27
18
{
28
-
if(string.IsNullOrEmpty(value))
29
-
{
30
-
thrownewArgumentNullException(nameof(value));
31
-
}
32
-
33
-
if(string.IsNullOrEmpty(code))
19
+
PredefinedKeys=new[]
34
20
{
35
-
thrownewArgumentNullException(nameof(code));
36
-
}
21
+
Key.Backspace,
22
+
Key.Tab,
23
+
Key.Enter,
24
+
Key.Pause,
25
+
Key.Escape,
26
+
Key.Space,
27
+
Key.PageUp,
28
+
Key.PageDown,
29
+
Key.End,
30
+
Key.Home,
31
+
Key.Left,
32
+
Key.Up,
33
+
Key.Right,
34
+
Key.Down,
35
+
Key.Insert,
36
+
Key.Delete,
37
+
Key.Equal,
38
+
Key.NumberPad0,
39
+
Key.NumberPad1,
40
+
Key.NumberPad2,
41
+
Key.NumberPad3,
42
+
Key.NumberPad4,
43
+
Key.NumberPad5,
44
+
Key.NumberPad6,
45
+
Key.NumberPad7,
46
+
Key.NumberPad8,
47
+
Key.NumberPad9,
48
+
Key.Multiply,
49
+
Key.Add,
50
+
Key.Subtract,
51
+
Key.NumberPadDecimal,
52
+
Key.Divide,
53
+
Key.F1,
54
+
Key.F2,
55
+
Key.F3,
56
+
Key.F4,
57
+
Key.F5,
58
+
Key.F6,
59
+
Key.F7,
60
+
Key.F8,
61
+
Key.F9,
62
+
Key.F10,
63
+
Key.F11,
64
+
Key.F12,
65
+
Key.Control,
66
+
Key.Shift,
67
+
Key.Alt,
68
+
Key.Command
69
+
}.ToDictionary(k =>(k.Value,k.Code));
70
+
}
37
71
38
-
Value=value;
39
-
Code=code;
72
+
privateKey(stringvalue)
73
+
:this(value,value)
74
+
{
40
75
}
41
76
42
-
/// <summary>
43
-
/// Creates a new instance of the <see cref="Key"/> class.
0 commit comments