Link to home
Start Free TrialLog in
Avatar of frangers99
frangers99

asked on

Virtual Keys

I own a Compaq Presario Laptop and for those of you unfamilar with the Presario brand, there are some special keys that are native to the Presario such as the i, search, shopping, mail, and volume buttons. How do i find the virtual key codes for these special keys?

i tried creating a small app when on the keypress it send the integer value to a caption. this worked fine for all keys except the compaq special keys, on pressing the special keys, no value was returned (as if the key had never been pressed).

Any ideas?
Avatar of Mohammed Nasman
Mohammed Nasman
Flag of Palestine, State of image

try to do that in keydown event with keycode, cuz in keypress will not capture all the keys
Try the same code in the "keydown" section of the program and check that the codes returned are correct for the vk keys.

for example:

...
  vk_Back      = $08;
  vk_Tab       = $09;
  vk_Clear     = $0C;
  vk_Return    = $0D;
  vk_Shift     = $10;
  vk_Control   = $11;
  vk_Menu      = $12;
  vk_Pause     = $13;
  vk_Capital   = $14;
...

Depending on what code you are using, it should show a value given for the key you are looking for although i don't have the compaq keyboard to test for the keys you mention.
ASKER CERTIFIED SOLUTION
Avatar of Mohammed Nasman
Mohammed Nasman
Flag of Palestine, State of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Have you tried checking for these vk codes?

Const VK_OEM_2 = &HBF
Const VK_OEM_3 = &HC0
Const VK_OEM_4 = &HDB
Const VK_OEM_5 = &HDC
Const VK_OEM_6 = &HDD
Const VK_OEM_7 = &HDE
Const VK_OEM_8 = &HDF


They may be mapped to the keys you are looking for.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept mnasman's comment as answer

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer