Key Up Event?
Quote from Forum Archives on November 15, 1997, 12:06 amPosted by: rush <rush@...>
Why does the following code only respond to the keydown event?DIM gQuit%
END GLOBALSLOCAL FN SetEvtMask
POKE _sysEvtMask, &HFFFF '<-- poke word to enable key-up events
END FNLOCAL FN DoMacEvent
macEvnt% = {EVENT}
SELECT macEvnt%
CASE _mButDwnEvt
gQuit% = _true
CASE _keyDwnEvt
keypressed=PEEK(EVENT+_evtMessage+3)
PRINT keypressed" pressed!"
CASE _keyUpEvt
keypressed=PEEK(EVENT+_evtMessage+3)
PRINT keypressed" Key up!!
CASE ELSE
END SELECT
POKE EVENT, _nullEvt
END FNWINDOW 1
FN SetEvtMask '<-- call once at start of program
ON EVENT FN DoMacEventDO
HANDLEEVENTS
UNTIL gQuit%
ENDMartin Fitzgibbons
Rush Software
Posted by: rush <rush@...>
DIM gQuit%
END GLOBALS
LOCAL FN SetEvtMask
POKE _sysEvtMask, &HFFFF '<-- poke word to enable key-up events
END FN
LOCAL FN DoMacEvent
macEvnt% = {EVENT}
SELECT macEvnt%
CASE _mButDwnEvt
gQuit% = _true
CASE _keyDwnEvt
keypressed=PEEK(EVENT+_evtMessage+3)
PRINT keypressed" pressed!"
CASE _keyUpEvt
keypressed=PEEK(EVENT+_evtMessage+3)
PRINT keypressed" Key up!!
CASE ELSE
END SELECT
POKE EVENT, _nullEvt
END FN
WINDOW 1
FN SetEvtMask '<-- call once at start of program
ON EVENT FN DoMacEvent
DO
HANDLEEVENTS
UNTIL gQuit%
END
Martin Fitzgibbons
Rush Software