Solved

Virtual Keys

Posted on 2001-07-05
5
361 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:mnasman
Comment Utility
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
Comment Utility
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:
mnasman earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…

763 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

9 Experts available now in Live!

Get 1:1 Help Now