Solved

Numlock & Caps lock  (Easy)

Posted on 1998-08-08
3
323 Views
Last Modified: 2010-04-04

How can i check the state of Numlock & Caps lock keys?

Thanks!!
0
Comment
Question by:dia050398
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 70 total points
ID: 1361742
Hi dia,

function LowOrderBitSet( Value: integer ): boolean;
begin
 Result := (Value and 1 > 0);
end;

function CapsLock : boolean;
begin
 if LowOrderBitSet(GetKeyState(VK_CAPITAL))then Result := True
 else Result := False;
end;

function InsertOn: boolean;
 { Returns the status of the Insert key.    }
begin
 if LowOrderBitSet(GetKeyState(VK_INSERT))then Result := True
  else Result := False;
end;

function NumLock : boolean;
begin
 if LowOrderBitSet(GetKeyState(VK_NUMLOCK))then Result := True
  else Result := False;
end;

function ScrollLock : boolean;
begin
 if LowOrderBitSet(GetKeyState(VK_SCROLL))then Result := True
 else Result := False;
end;

This is a way.

Regards, Zif.
0
 

Author Comment

by:dia050398
ID: 1361743
Sometimes Numlock Doesn´t work
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1361744
weird... can you check when exactely?
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

809 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