Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Detecting the keyboard status

Posted on 1997-11-28
2
Medium Priority
?
153 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

636 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