Note: The KNOB keyword is for compatibility with HP Workstation BASIC even though on modern computers it is actually a mouse.
ON KNOB specifies the time interval in seconds for which movement of the KNOB is sampled. Nothing happens, however, until the first time the KNOB is moved after the ON KNOB statement has been executed. Once initial movement of the KNOB is detected, a timer begins for the specified interval. When the interval has expired, KNOBX and KNOBY are set to the distance the KNOB moved during the interval. A KNOB event is then generated. The value of seconds can range from 0.01 to 2.55 but is rounded to the timing resolution of the computer.
The KNOBX and KNOBY functions are read to determine the number of increments the KNOB has been moved in the x and the y directions during the interval.
Executing a new ON KNOB while another ON KNOB is still in effect overrides the previous ON KNOBdefinition. If the ON KNOB is executed in a different program context, the original ON KNOB definition is restored when control returns to the calling context.