home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
PROG_BAS
/
DNALIB59.ZIP
/
LOCKS.BAS
< prev
next >
Wrap
BASIC Source File
|
1994-01-21
|
2KB
|
110 lines
DECLARE SUB CalcByte(Attr%,LowByte%,HiByte%)
SUB LockStatus(Row%,Col%,BarAttr%,StatusAttr%)PUBLIC
CalcByte BarAttr%,BarFG%,BarBG%
CalcByte StatusAttr%,StFG%,StBG%
REG 1,&h1200
CALL INTERRUPT &h16
b% = ABS(REG(1))
IF (b% and 32) = 32 THEN NumLock% = 1 ELSE NumLock% = 0
IF (b% and 64) = 64 THEN CapsLock% = 1 ELSE CapsLock% = 0
LOCATE Row%,Col%,0
COLOR BarFG%,BarBG%
PRINT SPACE$(10);
LOCATE Row%,Col%,0
COLOR StFG%,StBG%
IF CapsLock% THEN PRINT " CAPS ";
LOCATE Row%,Col% + 5,0
IF NumLock% THEN PRINT " NUM ";
END SUB
'----------------------------------------------------------------------------
FUNCTION InsertKey%()PUBLIC
REG 1,&h1200
CALL INTERRUPT &h16
b% = ABS(REG(1))
IF (b% and 128) = 128 THEN InsertKey% = 1 ELSE InsertKey% = 0
END FUNCTION
'----------------------------------------------------------------------------
FUNCTION KeyDown%()PUBLIC
DIM ABSOLUTE BIOS(&H300) AS INTEGER AT 0
IF BIOS(&H20C) = 32 OR BIOS(&H20C) = 64 THEN
DELAY .1
KeyDown% = 1
ELSE
KeyDown% = 0
END IF
END FUNCTION
'----------------------------------------------------------------------------
FUNCTION AltKey%()PUBLIC
REG 1,&H1200
CALL INTERRUPT &H16
b% = ABS(REG(1))
IF (b% and 8) = 8 THEN
AltKey% = 1
ELSE
AltKey% = 0
END IF
END FUNCTION
'----------------------------------------------------------------------------
FUNCTION CtrlKey%()PUBLIC
REG 1,&H1200
CALL INTERRUPT &H16
b% = ABS(REG(1))
IF (b% and 4) = 4 THEN
CtrlKey% = 1
ELSE
CtrlKey% = 0
END IF
END FUNCTION
'----------------------------------------------------------------------------
FUNCTION RightShift%()PUBLIC
REG 1,&H1200
CALL INTERRUPT &H16
b% = ABS(REG(1))
IF (b% AND 1) = 1 THEN
RightShift% = 1
ELSE
RightShift% = 0
END IF
END FUNCTION
'----------------------------------------------------------------------------
FUNCTION LeftShift%()PUBLIC
REG 1,&H1200
CALL INTERRUPT &H16
b% = ABS(REG(1))
IF (b% and 2) = 2 THEN
LeftShift% = 1
ELSE
LeftShift% = 0
END IF
END FUNCTION