Solved

Virtual Keys

Posted on 2001-07-05
5
367 Views
Last Modified: 2013-11-15
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?
0
Comment
Question by:frangers99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6254691
try to do that in keydown event with keycode, cuz in keypress will not capture all the keys
0
 
LVL 3

Expert Comment

by:Sabre
ID: 6254706
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.
0
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 100 total points
ID: 6254720
try this code


procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  ShowMessage(intToStr(Key));
end;

it will give u the key code for every key u press
0
 
LVL 3

Expert Comment

by:Sabre
ID: 6254786
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.
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8701919
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
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to fix error ""Failed to validate the vCentre certificate. Either install or verify the certificate by using the vSphere Data Protection Configuration utility" when you are trying to connect to VDP instance from Vcenter.
Microsoft will be releasing the Windows 10 Creators Update in just a matter of weeks. Are you prepared? Follow these steps to ensure everything goes smoothly and you don't lose valuable data on your PC.
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question