Board index » delphi » turn off num lock, scroll lock

turn off num lock, scroll lock

Quote
Robert J.N. Speirs wrote in message ...
>Please post a procedure to turn off num lock,
>and a procedure to turn off scroll lock.

Please read Prof. Salmi's FAQs, posted here
once every week. FAQPAS4, Question 77
deals with your query.

KlausL

 

Re:turn off num lock, scroll lock


Robert J.N. Speirs <spe...@primus.ca> a crit :

Quote
> Please post a procedure to turn off num lock,
> and a procedure to turn off scroll lock.

Real mode:
Mem[$0040:$17]:=Mem[$0040:$17] or $20;  {NumLock ON}
Mem[$0040:$17]:=Mem[$0040:$17] and (not $20);  {NumLock OFF}
{NumLock: $20, ScrollLock: $10, CapsLock: $40}

Protected mode:  {use Seg0040 instead of $0040}
Mem[Seg0040:$17]:=Mem[Seg0040:$17] or $20;

Windows:
uses WinProcs, WinTypes; {also Win31 for VK_SCROLL}
var KeyState: TKeyboardState;
begin
  GetKeyboardState(KeyState);
  KeyState[VK_NUMLOCK]:=#1; {#0: OFF, #1: ON}
  SetKeyboardState(KeyState);
end.
{VK_CAPITAL for CapsLock, VK_SCROLL for ScrollLock}
___________
Olivier Avenel  SPEC / CEA-Saclay   91191 Gif-sur-Yvette Cedex  France
ave...@drecam.saclay.cea.fr

Re:turn off num lock, scroll lock


Bullwinkle J. Moose <Bullwin...@minn.usa> wrote:

Quote
> Procedure for num lock:
> Press and release the "Num Lock" button
> ONCE (on most keyboards, it's located in the
> upper left hand corner of the keyPAD area).
> I don't know how to do the scroll lock -
> perhaps somebody else knows the procedure
> for that?

Doesn't your keyboard have a scroll lock button? Mine does... (in between
Print Screen/SysRq and Pause/Break).

--
______________________________________________________________________
     The Scarlet Manuka,      |        Nitpickers' Party motto:
  Pratchett Quoter At Large,  |  "He who guards his lips guards his
 First Prophet of Bonni, is:  |  soul, but he who speaks rashly will
   sa...@maths.uwa.edu.au     |    come to ruin." -- Proverbs 13:3
______________________________|_______________________________________

Other Threads