BBS: Inland Empire Archive Date: 06-15-92 (04:33) Number: 402 From: MARK BUTLER Refer#: 140 To: PHIL HODGES Recvd: NO Subj: Numlock help Conf: (2) Quik_Bas
On 06-12-92 Phil Hodges wrote to Mike Melamed...
PH> MM>Is there a way to detect NumLock or CapsLock or Scroll Lock?
PH> MM> ^^^^^^
PH>
PH> Well, PBClone does such a thing, but if you don't want yet another
PH> Library (my LIB directory has almost reached 1.5MB!), you can try
PH> the following code (that I'm writing as I go along... :-) )
PH>
PH> DEF SEG=&H40
PH> IsCaps=PEEK(&H17) or 64
PH> IsNum=PEEK(&H17) or 32
I think this should be...
IsCaps=PEEK(&H17) AND 64
^^^
shouldn't it?
To be used as a boolean (false = 0, true = -1)
it might go something like this...
FUNCTION IsCaps%
DEF SEG = &H40
Caps% = PEEK(&H17) AND 64
DEF SEG
IF Caps% = 64 THEN
IsCaps% = -1
ELSE
IsCaps% = 0
END IF
END FUNCTION
PH> Don't know about Scroll Lock.
IsScroll=PEEK(&H17) AND 16
PH> Hell, I'm not even sure what scroll lock DOES!
It locks them thar pesky lil' scrolls up in their corral so's they
don't be a-running `round loose all over creation! <grin>
-------------> MHB ;^]
... OFFLINE 1.38 * Life is what happens while you're busy making other plans
--- DB B1073/001271
* Origin: * Bare Bones BBS * (1:105/360)

Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET