No keyboard input with PyQt GUI on Linux

2020-05-05 16:50发布

问题:

I have created several widgets and a mainwindow in qt-designer and changed them to python files with pyuic5 -o filename.py filename.ui in the terminal in VSCode.

When I run this from the terminal in VSCode this works and I can use "Tab" to change between buttons and line edit widgets and spinboxes and the keyboard to type into the fields in the GUI.

However, when I try to run the .py files from the linux terminal I am able to open the GUI, but not able to use the keyboard to type in the fields or use "tab" to navigate in the GUI. I am able to use the mouse and click and then select paste, but not ctrl + C or ctr + shift + C.

I am writing in PyQt5 and uses python3 through anaconda to try to run it on the linux server.

I get these error codes when I try to run on linux:

Qt: XKEYBOARD extension not present on the X server.

Qt: Could not determine keyboard configuration data from X server, will use hard-coded keymap configuration.

Qt: Failed to compile a keymap!