◄Contents► ◄Index► ◄Back► ────────────────────────────────────────────────────────────────────────────── PEN enables, disables, or suspends light-pen event trapping. If event trapping is enabled, ON PEN branches to a subroutine whenever the light pen is activated. PEN ON PEN OFF PEN STOP ON PEN GOSUB line ■ PEN ON Enables light-pen event trapping. ■ PEN OFF Disables light-pen event trapping. ■ PEN STOP Suspends light-pen event trapping. Events are processed once event trapping is enabled by PEN ON. ■ line The label or number of the first line of the event-trapping subroutine. Example: 'This example requires a light pen. ON PEN GOSUB Handler PEN ON PRINT "Press Esc to exit." DO UNTIL INKEY$ = CHR$(27): LOOP END Handler: PRINT "Pen is at row"; PEN(6); ", column"; PEN(7) RETURN See Also ◄PEN Function►