home *** CD-ROM | disk | FTP | other *** search
- *
- * Toggle and inquire state of keys from Clipper Summer 87
- *
- * This simple demo will show the use of KEYLOCK.ASM
- * The file KEYLOCK.OBJ (included in archive) must be linked along with
- * your program (in this case TST.PRG)
- *
- * Compile: CLIPPER TST
- * Link: TLINK /x/n tst keylock,,,clipper <-- Turbo C linker
- * or LINK tst+keylock,,,clipper /SE:256 <-- Microsoft linker
- *
- CLEAR
- ? "Test KEYLOCK.ASM demo:"
- ? "It shows the use of functions LOCKSTAT() INSTOGG() CAPTOGG() NUMTOGG() SCRTOGG()"
- ?
- ? "Press [I][N][C][S] to see the toggles. [ESC] to exit."
- ?
- DO WHILE .T.
- x = LOCKSTAT()
- @ 10,0 say "INSERT is: " + IF(SUBSTR(x,1,1) == "I", "on <-", "off ")
- @ 11,0 say "CAPS is: " + IF(SUBSTR(x,2,1) == "C", "on <-", "off ")
- @ 12,0 say "NUM is: " + IF(SUBSTR(x,3,1) == "N", "on <-", "off ")
- @ 13,0 say "SCROLL is: " + IF(SUBSTR(x,4,1) == "S", "on <-", "off ")
- INKEY(0)
- l_key = CHR(LASTKEY())
- DO CASE
- CASE l_key = CHR(27)
- EXIT
- CASE l_key = "I" .OR. l_key = "i"
- INSTOGG()
- CASE l_key = "C" .OR. l_key = "c"
- CAPTOGG()
- CASE l_key = "N" .OR. l_key = "n"
- NUMTOGG()
- CASE l_key = "S" .OR. l_key = "s"
- SCRTOGG()
- ENDCASE
- ENDDO .T.
- QUIT
-
- * EOF