Solved

Virtual Keys

Posted on 2001-07-05
5
363 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
  • 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

813 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now