I successfully use Python 3.7 (or an earlier version) to do my graphics interface with Matplotlib. I use a definition to close the graphics window and exit my program by pressing ESC, make a screenshot by pressing F10 etc. It works fine using the definition below:
def quit_figure(event):
if event.key == 'escape':
close(event.canvas.figure)
if event.key == 'f10':
savefig('0.png',dpi=150)
if event.key == 'f1':
sys.exit(0)
From time to time I decide to switch to the newest Python. Now it is 10.4 and suddenly all my old programs stopped working because don't respond to any keys ESC, F10, F1.
I haven't checked Python 3.8, 3.9 just jumped from 3.7 to 3.10.4 (32 and 64 any difference) changing anything in my programs. All works fine except for the reaction on the keyboard.
I have checked the Internet - no answer, installed and reinstalled Python 10.4 on a few computers, installed it on fresh Windows 10 11 etc. on Python 3.7 my programs work on 10.4 works except keyboard reaction. I must operate a mouse to exit my program.
I would be grateful for any suggestions.