num lock, caps lock, scroll lock lights 
Author Message
 num lock, caps lock, scroll lock lights

I have code for toggling the lights for scroll lock, etc.  But it seems that
Windows doesn't like it too much, causes minor errors.  Any thoughts,
suggestions on this code?

void ToggleScr(BOOL State)
{
if (!State)
{
asm MOV SI,0x40
asm MOV ES,SI
asm MOV AL,ES:[0x0017]
asm AND AL,0x0EF
asm MOV ES,SI
asm MOV ES:[0x0017],AL

Quote:
}

else
{
asm MOV SI,0x40
asm MOV ES,SI
asm MOV AL,ES:[0x0017]
asm OR AL,0x10
asm MOV ES,SI
asm MOV ES:[0x0017],AL
Quote:
}

asm MOV AH,1
asm INT 0x16

Quote:
}

Thanks
Nathaniel


Sat, 30 Nov 2002 03:00:00 GMT  
 num lock, caps lock, scroll lock lights
I have code for toggling the lights for scroll lock, etc.  But it seems that
Windows doesn't like it too much, causes minor errors.  Any thoughts,
suggestions on this code?

void ToggleScr(BOOL State)
{
if (!State)
{
asm MOV SI,0x40
asm MOV ES,SI
asm MOV AL,ES:[0x0017]
asm AND AL,0x0EF
asm MOV ES,SI
asm MOV ES:[0x0017],AL

Quote:
}

else
{
asm MOV SI,0x40
asm MOV ES,SI
asm MOV AL,ES:[0x0017]
asm OR AL,0x10
asm MOV ES,SI
asm MOV ES:[0x0017],AL
Quote:
}

asm MOV AH,1
asm INT 0x16

Quote:
}

Thanks
Nathaniel


Sat, 30 Nov 2002 03:00:00 GMT  
 num lock, caps lock, scroll lock lights


   >I have code for toggling the lights for scroll lock, etc.  But it
   >seems that Windows doesn't like it too much, causes minor errors.
   >Any thoughts, suggestions on this code?

Win-Doze doesn't allow that kind of direct hardware access.

You'll hafta either call a Win-Doze API function to accomplish
the task, or jump out of Protected mode into Real or Virtual 86
mode to access the hardware.



Sun, 01 Dec 2002 03:00:00 GMT  
 num lock, caps lock, scroll lock lights


Quote:

>    >I have code for toggling the lights for scroll lock, etc.  But it
>    >seems that Windows doesn't like it too much, causes minor errors.
>    >Any thoughts, suggestions on this code?

> Win-Doze doesn't allow that kind of direct hardware access.

> You'll hafta either call a Win-Doze API function to accomplish
> the task, or jump out of Protected mode into Real or Virtual 86
> mode to access the hardware.

Not so.  At least, not so for Win 9X.  Its just a couple of out's that
can be looked up in Ralph Brown's or any good BIOS reference.

Unfortunately, it only deals with the lights.  The state, I believe is a
constant in the BIOS data area (040:XXX), and I don't know if flipping
that has any effect while under Windows.

--
Paul Hsieh
http://www.pobox.com/~qed/dos.html



Mon, 02 Dec 2002 03:00:00 GMT  
 num lock, caps lock, scroll lock lights



Quote:

>Not so.  At least, not so for Win 9X.  Its just a couple of out's that
>can be looked up in Ralph Brown's or any good BIOS reference.

>Unfortunately, it only deals with the lights.  The state, I believe is a
>constant in the BIOS data area (040:XXX), and I don't know if flipping
>that has any effect while under Windows.

This (BP7) toggles the three lights, when run in a Win98 DOS box.

        begin
        repeat
        mem[$40:$17] := Mem[$40:$17] xor $70 ;
        readln
        until false
        end.

--

 Web <URL: http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
 Proper 4-line sig. separator is as above, a line exactly "-- " (SonOfRFC1036)
 Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)



Mon, 02 Dec 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. a traffic light program with lock's (num loack Caps loack and scroll lock)

2. Num Lock and Caps Lock

3. Num, Caps and Scroll Lock state?

4. how to on/off num lock, caps lock, scroll lock ???

5. how to display Num and Caps Lock state on status bar

6. Q: Determing num/caps lock status

7. {caps,num}lock - once more for the record

8. dos debug program to toggle num lock light

9. Scrolling & CAPS-LOCK key

10. DOS utility that controls Caps Lock & Num Lock keys

11. DBFNTX/1035 Lock failure - type lock

12. Page Lock vs. Record Lock

 

 
Powered by phpBB® Forum Software