Capturing key-press codes
A history of the key code for the last pressed front-panel key is maintained by the 2600B. When the
instrument is turned on (or when transitioning from local to remote operation), the key code is set to 0
(display.KEY_NONE).
When a front-panel key is pressed, the key code value for that key can be captured and returned.
There are two functions associated with the capture of key-press codes: display.getlastkey()
and display.waitkey().
display.getlastkey()
The display.getlastkey() function immediately returns the key code for the last pressed key.
The following programming example illustrates how to display the last key pressed:
key = display.getlastkey()
print(key)
The above code returns the key code value (see the following table). A value of
0 (display.KEY_NONE) indicates that the key code history had been cleared.