/[RomCheater]/trunk/Win32/libWin32/Win32/Input/DXKeysToScanCodes.cs
ViewVC logotype

Contents of /trunk/Win32/libWin32/Win32/Input/DXKeysToScanCodes.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 88 - (show annotations) (download)
Wed May 9 20:52:20 2012 UTC (9 years, 2 months ago) by william
File size: 5585 byte(s)

1 #define USE_DX_SCANCODES_ENUM // when not defined/present will cause compiler time errors saying that it is obsolete
2 using System;
3 using System.Collections.Generic;
4 using System.Text;
5 using System.Windows.Forms;
6
7 namespace libWin32.Win32.Input
8 {
9 #region Extensions Methods
10 public static class EnumExtensionMethods
11 {
12 #if !USE_DX_SCANCODES_ENUM
13 public static ENUM Assign<ENUM, BASE>(this Enum val, BASE assignable, where BASE : IConvertible
14 {
15 //bool isValidEnumValue = false;
16 //foreach (BASE value in Enum.GetValues(typeof(ENUM,,,
17 //{
18 // if (value.Equals(assignable,,
19 // {
20 // isValidEnumValue = true;
21 // }
22 //}
23 //if (!isValidEnumValue,
24 //{
25 // throw new InvalidCastException(string.Format("Value: {0} is not a valid enum value as defined in: {1}", assignable.ToString(,, typeof(ENUM,.Name,,;
26 //}
27 //else
28 //{
29 return (ENUM,Convert.ChangeType(assignable, Enum.GetUnderlyingType(val.GetType(,,,;
30 //}
31
32 }
33 #endif
34 }
35 #endregion
36
37 #if !USE_DX_SCANCODES_ENUM
38 [Obsolete("USE_DX_SCANCODES_ENUM is not defined, DXKeysToScanCodes is being pashed-out. Please assign using a short, instead.", true,]
39 #endif
40 public enum DXKeysToScanCodes : short
41 {
42 DIK_UNKOWN = 0x00,
43
44 #region Other DX Scan Codes
45 DIK_ESCAPE = 0x1,
46 DIK_1 = 0x2,
47 DIK_2 = 0x3,
48 DIK_3 = 0x4,
49 DIK_4 = 0x5,
50 DIK_5 = 0x6,
51 DIK_6 = 0x7,
52 DIK_7 = 0x8,
53 DIK_8 = 0x9,
54 DIK_9 = 0xA,
55 DIK_0 = 0xB,
56 DIK_MINUS = 0xC,
57 DIK_EQUALS = 0xD,
58 DIK_BACK = 0xE,
59 DIK_TAB = 0xF,
60 DIK_Q = 0x10,
61 DIK_W = 0x11,
62 DIK_E = 0x12,
63 DIK_R = 0x13,
64 DIK_T = 0x14,
65 DIK_Y = 0x15,
66 DIK_U = 0x16,
67 DIK_I = 0x17,
68 DIK_O = 0x18,
69 DIK_P = 0x19,
70 DIK_LBRACKET = 0x1A,
71 DIK_RBRACKET = 0x1B,
72 DIK_RETURN = 0x1C,
73 DIK_LCONTROL = 0x1D,
74 DIK_A = 0x1E,
75 DIK_S = 0x1F,
76 DIK_D = 0x20,
77 DIK_F = 0x21,
78 DIK_G = 0x22,
79 DIK_H = 0x23,
80 DIK_J = 0x24,
81 DIK_K = 0x25,
82 DIK_L = 0x26,
83 DIK_SEMICOLON = 0x27,
84 DIK_APOSTROPHE = 0x28,
85 DIK_GRAVE = 0x29,
86 DIK_LSHIFT = 0x2A,
87 DIK_BACKSLASH = 0x2B,
88 DIK_Z = 0x2C,
89 DIK_X = 0x2D,
90 DIK_C = 0x2E,
91 DIK_V = 0x2F,
92 DIK_B = 0x30,
93 DIK_N = 0x31,
94 DIK_M = 0x32,
95 DIK_COMMA = 0x33,
96 DIK_PERIOD = 0x34,
97 DIK_SLASH = 0x35,
98 DIK_RSHIFT = 0x36,
99 DIK_MULTIPLY = 0x37,
100 DIK_LMENU = 0x38,
101 DIK_SPACE = 0x39,
102 DIK_CAPITAL = 0x3A,
103 DIK_F1 = 0x3B,
104 DIK_F2 = 0x3C,
105 DIK_F3 = 0x3D,
106 DIK_F4 = 0x3E,
107 DIK_F5 = 0x3F,
108 DIK_F6 = 0x40,
109 DIK_F7 = 0x41,
110 DIK_F8 = 0x42,
111 DIK_F9 = 0x43,
112 DIK_F10 = 0x44,
113 DIK_NUMLOCK = 0x45,
114 DIK_SCROLL = 0x46,
115 DIK_NUMPAD7 = 0x47,
116 DIK_NUMPAD8 = 0x48,
117 DIK_NUMPAD9 = 0x49,
118 DIK_SUBTRACT = 0x4A,
119 DIK_NUMPAD4 = 0x4B,
120 DIK_NUMPAD5 = 0x4C,
121 DIK_NUMPAD6 = 0x4D,
122 DIK_ADD = 0x4E,
123 DIK_NUMPAD1 = 0x4F,
124 DIK_NUMPAD2 = 0x50,
125 DIK_NUMPAD3 = 0x51,
126 DIK_NUMPAD0 = 0x52,
127 DIK_DECIMAL = 0x53,
128 DIK_OEM_102 = 0x56,
129 DIK_F11 = 0x57,
130 DIK_F12 = 0x58,
131 DIK_F13 = 0x64,
132 DIK_F14 = 0x65,
133 DIK_F15 = 0x66,
134 DIK_KANA = 0x70,
135 DIK_ABNT_C1 = 0x73,
136 DIK_CONVERT = 0x79,
137 DIK_NOCONVERT = 0x7B,
138 DIK_YEN = 0x7D,
139 DIK_ABNT_C2 = 0x7E,
140 DIK_NUMPADEQUALS = 0x8D,
141 DIK_PREVTRACK = 0x90,
142 DIK_AT = 0x91,
143 DIK_COLON = 0x92,
144 DIK_UNDERLINE = 0x93,
145 DIK_KANJI = 0x94,
146 DIK_STOP = 0x95,
147 DIK_AX = 0x96,
148 DIK_UNLABELED = 0x97,
149 DIK_NEXTTRACK = 0x99,
150 DIK_NUMPADENTER = 0x9C,
151 DIK_RCONTROL = 0x9D,
152 DIK_MUTE = 0xA0,
153 DIK_CALCULATOR = 0xA1,
154 DIK_PLAYPAUSE = 0xA2,
155 DIK_MEDIASTOP = 0xA4,
156 DIK_VOLUMEDOWN = 0xAE,
157 DIK_VOLUMEUP = 0xB0,
158 DIK_WEBHOME = 0xB2,
159 DIK_NUMPADCOMMA = 0xB3,
160 DIK_DIVIDE = 0xB5,
161 DIK_SYSRQ = 0xB7,
162 DIK_RMENU = 0xB8,
163 DIK_PAUSE = 0xC5,
164 DIK_HOME = 0xC7,
165 DIK_UP = 0xC8,
166 DIK_PRIOR = 0xC9,
167 DIK_PAGEUP = DIK_PRIOR, // DIK_PRIOR, synonym
168 DIK_PGUP = DIK_PRIOR, // DIK_PAGEUP, synonym
169 DIK_LEFT = 0xCB,
170 DIK_RIGHT = 0xCD,
171 DIK_END = 0xCF,
172 DIK_DOWN = 0xD0,
173 DIK_NEXT = 0xD1,
174 DIK_PAGEDOWN = DIK_NEXT, // DIK_NEXT, synonym
175 DIK_PGDN = DIK_NEXT, // DIK_PAGEDOWN, synonym
176 DIK_INSERT = 0xD2,
177 DIK_DELETE = 0xD3,
178 DIK_LWIN = 0xDB,
179 DIK_RWIN = 0xDC,
180 DIK_APPS = 0xDD,
181 DIK_POWER = 0xDE,
182 DIK_SLEEP = 0xDF,
183 DIK_WAKE = 0xE3,
184 DIK_WEBSEARCH = 0xE5,
185 DIK_WEBFAVORITES = 0xE6,
186 DIK_WEBREFRESH = 0xE7,
187 DIK_WEBSTOP = 0xE8,
188 DIK_WEBFORWARD = 0xE9,
189 DIK_WEBBACK = 0xEA,
190 DIK_MYCOMPUTER = 0xEB,
191 DIK_MAIL = 0xEC,
192 DIK_MEDIASELECT = 0xED,
193 #endregion
194 }
195 }

  ViewVC Help
Powered by ViewVC 1.1.22