«« Site Rescued »»

While the site is still going to move from its current host, a new site will now take its place. More Info.

The new site may have less content, but the core will now remain. And it will now play nicely with phones! Keep an eye on the DelphiDabbler Blog for news.

» 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 »