[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

scan codes

I'd like to know the scan code of "ESC" and "Windows" Key.
Who can give me a hand please?
0
cookey
Asked:
cookey
  • 2
1 Solution
 
ahalyaCommented:
found these in my Windows.pas.  Are they ok ?

  VK_ESCAPE = 27;
  VK_LWIN = 91;
  VK_RWIN = 92;
0
 
ahalyaCommented:
oops, looks like what i have listed are the virtual keycodes.

But i think you can use the MapVirtualkey function to get the scancode i'll assume.


scancode := MapVirtualKey(vkey, 0);
0
 
sburckCommented:
There are two level for 'scan-codes'.  The actual scan codes the keyboards generate are, for the most part, found here:

http://www.geocities.com/SiliconValley/Bay/8302/keybrd.htm

Unfortunately, these are based on the 101 key keyboard, not the 104, so the Windows key is absent.  ESC is 76 (decimal) here, I cannot find the info for the Windows key.

More useful for the Delphi programmer is the BIOS translation of these scancodes.  For keys that have an ASCII value (like ESC), they will get a Keypress event, and the others won't, but they both get KeyDown/Up events, and here, ESC is 27 and Windows is 91.
0
 
nricoCommented:
Something I always did in DOS (I guess it should work here as well): Just write a program that displays the scancode when you press a key. That way, you can find out the scancode of every key you want!!!!

(Order now)

;-)
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now