Notice Of Closure

Please note that this website is due to close down on 15th June 2020.

In the interim I will try to move as much content as possible over to my GitHub account. Thanks to everyone who has supported the site over the years.

» Help

How to turn numlock on by code

   

This function may come in especially handy when creating billing/financial applications where the keypad is a must. What it does is when called turns the NumLock status to "on".

uses
  Windows;
...
procedure SetNumLockOn;
var
  KeyState: TKeyBoardState;
begin
  GetKeyboardState(KeyState);
  if GetKeyState(VK_NUMLOCK) = 0 then begin
    KeyState[VK_NUMLOCK] := 1;
    SetKeyboardState(KeyState);
  end;
end;
Author: Unknown
Added: 2007-06-02
Last updated: 2007-06-02

« Return to contents »