Solved

Numlock & Caps lock  (Easy)

Posted on 1998-08-08
3
317 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
Comment Utility
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
Comment Utility
Sometimes Numlock Doesn´t work
0
 
LVL 8

Expert Comment

by:ZifNab
Comment Utility
weird... can you check when exactely?
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 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

12 Experts available now in Live!

Get 1:1 Help Now