Path: utzoo!utgpu!watserv1!watmath!att!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!caen!umich!sharkey!tygra!dave From: dave@tygra.ddmi.com (David Conrad) Newsgroups: comp.lang.pascal Subject: Re: Keyboard lights Summary: Toggle should update lights Keywords: Keyboard, BIOS, Shift States Message-ID: <518@tygra.ddmi.com> Date: 18 Nov 90 02:54:00 GMT References: <2526@oucsace.cs.OHIOU.EDU> <22707@dime.cs.umass.edu> Reply-To: dave@tygra.UUCP (David Conrad) Organization: very little Lines: 54 [Oops, deleted attribution. Sorry.] ) )On my keyboard, at least (an IBM "enhanced" eight-pounder), there are two )different sets of bits. There is the one you're using, which flips )both the keyboard state and the LED, and there's another which flips just )the LED's. If you use the second one it's very easy to get the true )state out of sync with the indicator light, which can be annoying. The )problem is that many "compatible" BIOS's/keyboards don't seem to implement )this properly. Try playing around with the other byte, which I think is )located at $84. (For God's sake don't just write to that location without )seeing what it is; I've probably got it wrong) ) )Eli $40:$84 (1 byte): The number of rows on the screen - 1. $40:$17 (1 byte): Keyboard shift states: Bit Meaning 76543210 (1 = active; 0 = inactive) -------- -------------------------- x....... Insert State .x...... Caps Lock ..x..... Num Lock ...x.... Scroll Lock ....x... 1 = Alt pressed .....x.. 1 = Ctrl pressed ......x. 1 = Left Shift pressed .......x 1 = Right Shift pressed $40:$18 (1 byte): Extended keyboard shift states Bit Meaning 76543210 (1 = pressed) -------- -------------------------- x....... Ins pressed .x...... Caps Lock pressed ..x..... Num Lock pressed ...x.... Scroll Lock pressed ....x... Hold state active (Ctrl-Num Lock or Pause) .....x.. Sys Req key pressed ......x. Left Alt key pressed .......x Left Ctrl key pressed pressed means actually being held down [in]active means current toggle state "...it is potentially very disruptive to change any of the key-is-pressed bits (bits 0 through 3 of byte 0040:0017H or any bits in byte 0040:0018H)." -- The *New* Peter Norton Programmer's Guide to The IBM PC & PS/2; Peter Norton, Richard Wilton; Microsoft Press; ISBN 1-55615-131-4. -- David R. Conrad dave@tygra.ddmi.com This article is in the public domain. -- = CAT-TALK Conferencing Network, Prototype Computer Conferencing System = - 1-800-825-3069, 300/1200/2400/9600 baud, 8/N/1. New users use 'new' - = as a login id. <>> = E-MAIL Address: dave@ThunderCat.COM