;Copyright 2000 - Mark McDonald All rights reserved
; DECLARE: FUNCTION isctrlp() AS INTEGER
; DESC:    Returns true if a Ctrl key is depressed.
; EXAMP:   IF isctrlp THEN GOTO ....
; ISCTRLP()
;     Is Control Key Pressed.
;     Returns 1 if Ctrl key is pressed.
;     Returns 0 if not.
;     EXAMPLE:  T = ISCTRLP   0

MCODE Segment Byte
        Assume  CS: MCODE

        Public  isctrlp

isctrlp Proc Far
        push    ES                      ;

        xor     AX,AX                   ; clear AX
        mov     ES,AX                   ; set ES to BIOS data segment
        test    Byte Ptr ES: [417h],4   ; is a Ctrl key depressed?
        jz      Exit                    ; no, exit
        inc     AX                      ; return true (1)
Exit:
        pop     ES                      ;
        retf
isctrlp EndP
MCODE EndS
        End