BBS: Inland Empire Archive Date: 03-19-92 (00:37) Number: 145 From: SEAN EMBRY Refer#: NONE To: ALL Recvd: NO Subj: Caps Num Scrl Lock prg Conf: (2) Quik_Bas
Some one asked for a program to turn on and off the Caps, Num, and Scrl lock keys the other day, so here's mine. Dave, please get out your red pencil and mark it up! You too Richard! And Billy, and......... '''''''''''''''''''''''''''''''''''''''''''''''''''' ' PROGRAM: KEYS.BAS ' ' INCLDTO: COMMON.BAS ' ' REV : 920208 1.2 ' ' STATUS : LIBSRCE LIB:COMMON.BAS NO (C) ' ' Sean Embry ' ' P.O. Box 483 ' ' Portland Tx.78374 ' ' Code Clipper from Hell (c) 1992 Sean Embry ' '8<------------CUT HERE--------------------------->8 ' Calling any of the below with 0 will turn off that key. ' Calling with any other number will turn on that key. DECLARE SUB Key.CapLoc (State AS INTEGER) DECLARE SUB Key.NumLoc (State AS INTEGER) DECLARE SUB Key.ScrLoc (State AS INTEGER) DEFINT A-Z CLS ' lets go out and turn them off Key.CapLoc 0 Key.NumLoc 0 Key.ScrLoc 0 ' Now go turn them on! PRINT "All the lights should be off now, press return and they will turn on"; A WHILE INKEY$ = "" WEND Key.CapLoc 1 Key.NumLoc 2 Key.ScrLoc 3 'The program dosn't care WHAT number it is passed, if it isn't 0, it 'turns it on. SUB Key.CapLoc (State%) IF State% THEN DEF SEG = &H40: POKE &H17, PEEK(&H17) OR 64: DEF SEG ELSE DEF SEG = &H40: POKE &H17, PEEK(&H17) AND 191: DEF SEG END IF END SUB SUB Key.NumLoc (State%) IF State% THEN DEF SEG = &H40: POKE &H17, PEEK(&H17) OR 32: DEF SEG ELSE DEF SEG = &H40: POKE &H17, PEEK(&H17) AND 223: DEF SEG END IF END SUB SUB Key.ScrLoc (State%) IF State% THEN DEF SEG = &H40: POKE &H17, PEEK(&H17) OR 16: DEF SEG ELSE DEF SEG = &H40: POKE &H17, PEEK(&H17) AND 239: DEF SEG END IF END SUB ___ X OLX 2.1 TD X Bug free programs ready today. Prick finger & sign here. --- Maximus 2.01wb * Origin: Papa Smurf's Place (1:160/102)
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