?
Solved

Detecting the keyboard status

Posted on 1997-11-28
2
Medium Priority
?
151 Views
Last Modified: 2010-04-04
How do I detect whether the Caps Lock, Num Lock, etc
keys are enabled?

Thanks in advance
Email: wenwei@mbox2.singnet.com.sg
0
Comment
Question by:test031097
[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 Comments
 
LVL 3

Accepted Solution

by:
d4jaj1 earned 200 total points
ID: 1352344
You'd use the getkeystate method.  Suppose you wanted to display CAPS or INSERT to a statuspanel.  Add the code below to a Timer component (or what ever you want to kick this off, like them actually pressing the CAPS or Insert keys)

if odd (getkeystate (VK_CAPITAL)) then
   statusbar1.panels[2].text := 'CAPS'
else
   statusbar1.panels[2].text := '';

For the insert key, use VK_INSERT.  The entire VK listing is in the Delphi help file.  Any questions, please add a comment.

Good Luck!
Jay
0
 

Author Comment

by:test031097
ID: 1352345
Thanks a lot!!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

777 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