Forum Navigation
You need to log in to create posts and topics.

Key Up Event?

Posted by: rush <rush@...>

Why does the following code only respond to the keydown event?

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