Type of Issue (Enhancement, Error, Bug, Question)
Bug
Operating System
Alma Linux 9
PySimpleGUI Port (tkinter, Qt, Wx, Web)
tkinter
Versions (NOTE - PSG4 is no longer supported)
Python Interpeter: /usr/bin/python3
Python version: 3.9.18
Platform: Linux
Platform version: ('glibc', '2.34')
Port: PySimpleGUI
tkinter version: 8.6.10
PySimpleGUI version: 5.0.6
Priority Support Code (Commercial License Users)
n/a
Your Experience In Months or Years (optional)
Years Python programming experience: 8
Years Programming experience overall: 9
Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine) yes
Anything else you think would be helpful?
Troubleshooting
These items may solve your problem. Please check those you've done by changing - [ ] to - [X]
Detailed Description
I am running a GUI in Alma Linux 9 that interfaces with several classes I have written, which interface with several external systems. Sometimes, after the GUI has been in use for a bit, the keyboard spontaneously stops working. I have not been able to understand what causes this, nor been able to predict the issue. The keyboard still works in other windows, and I can still interact with the GUI in other ways (pressing buttons, etc.), so I believe it is an issue between PSG and the keyboard. I recently upgraded the operating system of the PC from Centos 7 to Alma 9; in Centos 7 this issue was not observed, and the code has not changed.
In debugging this, I have added enable_events=True to a few of the text boxes and told the GUI to print every event it sees. I have also added the following block which runs a keyboard listener while the GUI event loop runs:
from pynput import keyboard
def on_press(key):
try:
print('alphanumeric key {0} pressed'.format(
key.char))
except AttributeError:
print('special key {0} pressed'.format(
key))
def on_release(key):
print('{0} released'.format(
key))
if key == keyboard.Key.esc:
# Stop listener
return False
listener = keyboard.Listener(
on_press=on_press,
on_release=on_release)
listener.start()
When the keyboard issue I am discussing occurs, the events generated by buttons and checkboxes still appear in the terminal output, but no events generated by sg.Input fields show up. However, the listener I pasted above still prints all key presses and releases that occur while the GUI window is in focus, but no text is entered into the GUI and no sg.Input events appear.
Code To Duplicate
I have not been able to understand nor isolate the issue, so I am not sure I can give duplication code. I know how helpful that is, but I am running out of ideas for how to solve this.
Thanks for any help you can provide!
Type of Issue (Enhancement, Error, Bug, Question)
Bug
Operating System
Alma Linux 9
PySimpleGUI Port (tkinter, Qt, Wx, Web)
tkinter
Versions (NOTE - PSG4 is no longer supported)
Python Interpeter: /usr/bin/python3
Python version: 3.9.18
Platform: Linux
Platform version: ('glibc', '2.34')
Port: PySimpleGUI
tkinter version: 8.6.10
PySimpleGUI version: 5.0.6
Priority Support Code (Commercial License Users)
n/a
Your Experience In Months or Years (optional)
Years Python programming experience: 8
Years Programming experience overall: 9
Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine) yes
Anything else you think would be helpful?
Troubleshooting
These items may solve your problem. Please check those you've done by changing - [ ] to - [X]
Detailed Description
I am running a GUI in Alma Linux 9 that interfaces with several classes I have written, which interface with several external systems. Sometimes, after the GUI has been in use for a bit, the keyboard spontaneously stops working. I have not been able to understand what causes this, nor been able to predict the issue. The keyboard still works in other windows, and I can still interact with the GUI in other ways (pressing buttons, etc.), so I believe it is an issue between PSG and the keyboard. I recently upgraded the operating system of the PC from Centos 7 to Alma 9; in Centos 7 this issue was not observed, and the code has not changed.
In debugging this, I have added
enable_events=Trueto a few of the text boxes and told the GUI to print every event it sees. I have also added the following block which runs a keyboard listener while the GUI event loop runs:When the keyboard issue I am discussing occurs, the events generated by buttons and checkboxes still appear in the terminal output, but no events generated by
sg.Inputfields show up. However, the listener I pasted above still prints all key presses and releases that occur while the GUI window is in focus, but no text is entered into the GUI and nosg.Inputevents appear.Code To Duplicate
I have not been able to understand nor isolate the issue, so I am not sure I can give duplication code. I know how helpful that is, but I am running out of ideas for how to solve this.
Thanks for any help you can provide!