Skip to content

Instantly share code, notes, and snippets.

@viniciusfbb
Created November 28, 2022 15:04
Show Gist options
  • Save viniciusfbb/d6764ae331e957d67d65e1c933f5ded4 to your computer and use it in GitHub Desktop.
Save viniciusfbb/d6764ae331e957d67d65e1c933f5ded4 to your computer and use it in GitHub Desktop.
Delphi FMX key name, used in OnKeyDown/OnKeyUp
function KeyName(const AKey: Word): string;
begin
case AKey of
1: Result := 'vkLButton';
2: Result := 'vkRButton';
3: Result := 'vkCancel';
4: Result := 'vkMButton';
5: Result := 'vkXButton1';
6: Result := 'vkXButton2';
8: Result := 'vkBack';
9: Result := 'vkTab';
10: Result := 'vkLineFeed';
12: Result := 'vkClear';
13: Result := 'vkReturn';
16: Result := 'vkShift';
17: Result := 'vkControl';
18: Result := 'vkMenu';
19: Result := 'vkPause';
20: Result := 'vkCapital';
21: Result := 'vkKana/vkHangul';
23: Result := 'vkJunja';
24: Result := 'vkFinal';
25: Result := 'vkHanja/vkKanji';
28: Result := 'vkConvert';
29: Result := 'vkNonConvert';
30: Result := 'vkAccept';
31: Result := 'vkModeChange';
27: Result := 'vkEscape';
32: Result := 'vkSpace';
33: Result := 'vkPrior';
34: Result := 'vkNext';
35: Result := 'vkEnd';
36: Result := 'vkHome';
37: Result := 'vkLeft';
38: Result := 'vkUp';
39: Result := 'vkRight';
40: Result := 'vkDown';
41: Result := 'vkSelect';
42: Result := 'vkPrint';
43: Result := 'vkExecute';
44: Result := 'vkSnapshot';
45: Result := 'vkInsert';
46: Result := 'vkDelete';
47: Result := 'vkHelp';
48: Result := 'vk0';
49: Result := 'vk1';
50: Result := 'vk2';
51: Result := 'vk3';
52: Result := 'vk4';
53: Result := 'vk5';
54: Result := 'vk6';
55: Result := 'vk7';
56: Result := 'vk8';
57: Result := 'vk9';
61: Result := 'vkLCommand';
62: Result := 'vkRCommand';
63: Result := 'vkFunction';
65: Result := 'vkA';
66: Result := 'vkB';
67: Result := 'vkC';
68: Result := 'vkD';
69: Result := 'vkE';
70: Result := 'vkF';
71: Result := 'vkG';
72: Result := 'vkH';
73: Result := 'vkI';
74: Result := 'vkJ';
75: Result := 'vkK';
76: Result := 'vkL';
77: Result := 'vkM';
78: Result := 'vkN';
79: Result := 'vkO';
80: Result := 'vkP';
81: Result := 'vkQ';
82: Result := 'vkR';
83: Result := 'vkS';
84: Result := 'vkT';
85: Result := 'vkU';
86: Result := 'vkV';
87: Result := 'vkW';
88: Result := 'vkX';
89: Result := 'vkY';
90: Result := 'vkZ';
91: Result := 'vkLWin';
92: Result := 'vkRWin';
93: Result := 'vkApps';
95: Result := 'vkSleep';
96: Result := 'vkNumpad0';
97: Result := 'vkNumpad1';
98: Result := 'vkNumpad2';
99: Result := 'vkNumpad3';
100: Result := 'vkNumpad4';
101: Result := 'vkNumpad5';
102: Result := 'vkNumpad6';
103: Result := 'vkNumpad7';
104: Result := 'vkNumpad8';
105: Result := 'vkNumpad9';
106: Result := 'vkMultiply';
107: Result := 'vkAdd';
108: Result := 'vkSeparator';
109: Result := 'vkSubtract';
110: Result := 'vkDecimal';
111: Result := 'vkDivide';
112: Result := 'vkF1';
113: Result := 'vkF2';
114: Result := 'vkF3';
115: Result := 'vkF4';
116: Result := 'vkF5';
117: Result := 'vkF6';
118: Result := 'vkF7';
119: Result := 'vkF8';
120: Result := 'vkF9';
121: Result := 'vkF10';
122: Result := 'vkF11';
123: Result := 'vkF12';
124: Result := 'vkF13';
125: Result := 'vkF14';
126: Result := 'vkF15';
127: Result := 'vkF16';
128: Result := 'vkF17';
129: Result := 'vkF18';
130: Result := 'vkF19';
131: Result := 'vkF20';
132: Result := 'vkF21';
133: Result := 'vkF22';
134: Result := 'vkF23';
135: Result := 'vkF24';
136: Result := 'vkCamera';
137: Result := 'vkHardwareBack';
144: Result := 'vkNumLock';
145: Result := 'vkScroll';
160: Result := 'vkLShift';
161: Result := 'vkRShift';
162: Result := 'vkLControl';
163: Result := 'vkRControl';
164: Result := 'vkLMenu';
165: Result := 'vkRMenu';
166: Result := 'vkBrowserBack';
167: Result := 'vkBrowserForward';
168: Result := 'vkBrowserRefresh';
169: Result := 'vkBrowserStop';
170: Result := 'vkBrowserSearch';
171: Result := 'vkBrowserFavorites';
172: Result := 'vkBrowserHome';
173: Result := 'vkVolumeMute';
174: Result := 'vkVolumeDown';
175: Result := 'vkVolumeUp';
176: Result := 'vkMediaNextTrack';
177: Result := 'vkMediaPrevTrack';
178: Result := 'vkMediaStop';
179: Result := 'vkMediaPlayPause';
180: Result := 'vkLaunchMail';
181: Result := 'vkLaunchMediaSelect';
182: Result := 'vkLaunchApp1';
183: Result := 'vkLaunchApp2';
186: Result := 'vkSemicolon';
187: Result := 'vkEqual';
188: Result := 'vkComma';
189: Result := 'vkMinus';
190: Result := 'vkPeriod';
191: Result := 'vkSlash';
192: Result := 'vkTilde';
219: Result := 'vkLeftBracket';
220: Result := 'vkBackslash';
221: Result := 'vkRightBracket';
222: Result := 'vkQuote';
223: Result := 'vkPara';
226: Result := 'vkOem102';
227: Result := 'vkIcoHelp';
228: Result := 'vkIco00';
229: Result := 'vkProcessKey';
230: Result := 'vkIcoClear';
231: Result := 'vkPacket';
246: Result := 'vkAttn';
247: Result := 'vkCrsel';
248: Result := 'vkExsel';
249: Result := 'vkErEof';
250: Result := 'vkPlay';
251: Result := 'vkZoom';
252: Result := 'vkNoname';
253: Result := 'vkPA1';
254: Result := 'vkOemClear';
255: Result := 'vkNone';
else
Result := '(unknown)';
end;
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment