Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Virtual Keys

Posted on 2001-07-05
5
Medium Priority
?
370 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 300 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

VM backup deduplication is a method of reducing the amount of storage space needed to save VM backups. In most organizations, VMs contain many duplicate copies of data, such as VMs deployed from the same template, VMs with the same OS, or VMs that h…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
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…
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…

721 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