?
Solved

Numlock & Caps lock  (Easy)

Posted on 1998-08-08
3
Medium Priority
?
330 Views
Last Modified: 2010-04-04

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

Thanks!!
0
Comment
Question by:dia050398
[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
3 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 210 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
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