Re: Reading ctrl-c's without crashing program
- Posted by =?ISO-8859-1?Q?Jes=FAs_Consuegra?= <jconsuegra at REDESTB.ES> Feb 12, 1997
- 1010 views
------=_NextPart_000_01BC18D0.D0531020 Content-Transfer-Encoding: 8bit I needed a function to test if a key was pressed without disturbing the buffer, here is: -- By Jeszs Consuegra (jconsuegra at redestb.es) include machine.e include bitwise.e constant FALSE = 0, TRUE = 1, ZeroFlag = #40 global function keypressed() sequence reg_list reg_list = repeat(0,10) reg_list[REG_AX] = #0100 reg_list = dos_interrupt(#16, reg_list) if AND(reg_list[REG_FLAGS], ZeroFlag) = ZeroFlag then return FALSE else return TRUE end if end function ------------------ I still miss some SHR SHL bitwise shifts, and some serial port procedures/functions to allow changing the baud rate, etc. Any ideas? Thanks ------=_NextPart_000_01BC18D0.D0531020 Content-Description: keypress.e ()