ON KEY ====== Function -------- **ON KEY** specifies a routine to be executed when a soft key or cursor control key is pressed during program execution. Syntax ------ ON KEY (n) GOSUB line number Examples -------- :: ON KEY(1) GOSUB 5000 If function key 1 is pressed the program will execute the subroutine located at line 5000. Remarks ------- For a definition of n and details of using this function see the :doc:`key-n` statement. Line number specifies the trap routine, which must be terminated with a :doc:`return`.