[comp.sys.ibm.pc] NUMLOCK

liber@darth.PGH.PA.US (Eric Liber) (11/12/89)

The numlock, scroll lock and caps lock lights and system status are recorded
and set by the byte at 0040:0017 the bits of the byte have the following 
meaning:

	bit 0 - if set (=1) then the keyboard is in a permanent shifted state
 	bit 1 - ?
	bit 2 - ?
	bit 3 - ?
	bit 4 - scroll lock  - 0 = off  1 = on
	bit 5 - num lock  -    0 = off  1 = on
	bit 6 - caps lock -    0 = off  1 = onn

the only rational way to make the machine boot with numlock off is to create
a small program that you can include in your autoexec.bat to reset bit 5 of 
the byte.  These can also be helpful if you need to assure the setting of one
of these in an application program.
good luck
Eric (the red baron) Liber

toma@tekgvs.LABS.TEK.COM (Tom Almy) (11/13/89)

In article <523@darth.PGH.PA.US> liber@darth.PGH.PA.US (Eric Liber) writes:
>The numlock, scroll lock and caps lock lights and system status are recorded
>and set by the byte at 0040:0017 the bits of the byte have the following 
>meaning:
>
>	bit 0 - if set (=1) then the keyboard is in a permanent shifted state
No (from IBM PC/AT Technical Reference Manual), 
	bit 0 - right shift key depressed
> 	bit 1 - ?
	bit 1 - left shift key depressed
>	bit 2 - ?
	bit 2 - control key depressed
>	bit 3 - ?
	bit 3 - alt key depressed
>	bit 4 - scroll lock  - 0 = off  1 = on
>	bit 5 - num lock  -    0 = off  1 = on
>	bit 6 - caps lock -    0 = off  1 = onn

	bit 7 - Insert state active (toggles with Insert key??)

Tom Almy
toma@tekgvs.labs.tek.com
Standard Disclaimers Apply

fisher@sc2a.unige.ch (Markus Fischer) (11/14/89)

In article <523@darth.PGH.PA.US>, liber@darth.PGH.PA.US (Eric Liber) writes:
> The numlock, scroll lock and caps lock lights and system status are recorded
> and set by the byte at 0040:0017 the bits of the byte have the following 
> meaning:
> 
> 	bit 0 - if set (=1) then the keyboard is in a permanent shifted state
>  	bit 1 - ?
> 	bit 2 - ?
> 	bit 3 - ?
> 	bit 4 - scroll lock  - 0 = off  1 = on
> 	bit 5 - num lock  -    0 = off  1 = on
> 	bit 6 - caps lock -    0 = off  1 = onn

Well, actually it's a word...
	bit  0 - right shift
	bit  1 - left shift
	bit  2 - Control state
	bit  3 - Alt state
	bit  4 - Scroll Lock state
	bit  5 - Num Lock state
	bit  6 - Caps Lock state
	bit  7 - Insert state

	bit  8 - (left) control *key* down
	bit  9 - Alt key down
	bit 10 - ??
	bit 11 - ??
	bit 12 - Scroll Lock key down
	bit 13 - Num Lock key down
	bit 14 - Caps Lock key down
	bit 15 - Insert key down...
> 
> Eric (the red baron) Liber

Still, two question marks left...  And how does one detect the `AltGr' state ???

Markus Fischer