Board index » delphi » Num Lock, Caps Lock, Scroll Lock

Num Lock, Caps Lock, Scroll Lock

How can I get and set the states of each?

Thanks

 

Re:Num Lock, Caps Lock, Scroll Lock


Hi Sean!

Quote
> How can I get and set the states of each?

Sorry, I don't know in Windows, but maybe this helps...

In DOS it was in the BIOS (0040:0018)-READONLY
   bit 7 : Insert
   bit 6 : Caps Lock
   bit 5 : Num Lock
   bit 4 : Scroll Lock
   bit 3 : Control-Num Lock or Pause
   bit 2 : Sys Req (=Alt Sys Req = Print Screen)
   bit 1 : Left Alt
   bit 0 : Right Alt

(also Int 16h/AH=2)
In DOS it was in the BIOS (0040:0017)-WRITE/READ
   bit 7 : Insert
   bit 6 : Caps Lock
   bit 5 : Num Lock
   bit 4 : Scroll Lock
   bit 3 : Alt
   bit 2 : Control
   bit 1 : Left Shift
   bit 0 : Right Shift

(also Int 16h/AH=12h => 2 bytes)

Each time Windows starts I set Caps Lock and Num Lock off with
an own written small assemblerprogram using this address, and
it works!?! Normally it shouldn't, but it works.

Read the post of Alan Lloyd "Get BIOS number",5 may
but I don't find this byte in his text. Maybe he knows it.

Cheers,
Rudy

Re:Num Lock, Caps Lock, Scroll Lock


Hi Sean,
Here is an example:

function IsKeyOn(Key: integer): boolean;
begin
  result:=boolean(GetKeyState(Key) and 1);
end;

Best regards,
--
~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~
Rafael Ribas Aguil - Rio de Janeiro - Brazil
rri...@unisys.com.br
~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~
Puralgica Ltda Me
plog...@unisys.com.br
~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~

Sean Hamilton <breadst...@planetquake.com> wrote in article
<KnPY2.1954$ci.551...@NewsRead.Toronto.iSTAR.net>...

Quote
> How can I get and set the states of each?

> Thanks

Re:Num Lock, Caps Lock, Scroll Lock


Sean, I forgot to tell you about the keys. You need to use the virtual key
codes like VK_CAPITAL for CapsLock for example.
--
~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~
Rafael Ribas Aguil - Rio de Janeiro - Brazil
rri...@unisys.com.br
~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~
Puralgica Ltda Me
plog...@unisys.com.br
~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~

Sean Hamilton <breadst...@planetquake.com> wrote in article
<KnPY2.1954$ci.551...@NewsRead.Toronto.iSTAR.net>...

Quote
> How can I get and set the states of each?

> Thanks

Re:Num Lock, Caps Lock, Scroll Lock


Hi

Can you create an event like OnScrollLock ?

Saar

Rafael Ribas Aguil ? ???? <01be9952$18e23b00$d412dcc8@rra>...

Quote
>Hi Sean,
>Here is an example:

>function IsKeyOn(Key: integer): boolean;
>begin
>  result:=boolean(GetKeyState(Key) and 1);
>end;

>Best regards,
>--
>~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~
>Rafael Ribas Aguil - Rio de Janeiro - Brazil
>rri...@unisys.com.br
>~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~
>Puralgica Ltda Me
>plog...@unisys.com.br
>~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~o~

>Sean Hamilton <breadst...@planetquake.com> wrote in article
><KnPY2.1954$ci.551...@NewsRead.Toronto.iSTAR.net>...
>> How can I get and set the states of each?

>> Thanks

Other Threads