Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 21 globality problem #23

Open
brezniczky opened this issue Jul 9, 2021 · 1 comment
Open

Ubuntu 21 globality problem #23

brezniczky opened this issue Jul 9, 2021 · 1 comment

Comments

@brezniczky
Copy link

brezniczky commented Jul 9, 2021

Hello!

I am trying to use the package on Ubuntu 21.04, and it seems the "globality" of the hotkeys is very much reduced there.

The simplistic example, which at the heart is

hk = SystemHotkey()
hk.register(('control', 'shift', 'h'), callback=lambda x:print("Easy!", x))

will not receive keystrokes, except when the corresponding widget has focus (I am embedding this in a Qt application), i.e. not even when the corresponding parent console window receives input.

Is there any idea how I could get across this to keep using system-hotkey - did I miss anything?

Thank you!


A 'working' snippet (well it works on Ubuntu 18/20) to allow for reproducing the behaviour:

from PySide2.QtWidgets import QApplication, QDialog
from system_hotkey import SystemHotkey


hk = SystemHotkey()
hk.register(('control', 'shift', 'h'), callback=lambda x:print("Easy!", x))


app = QApplication()
dialog = QDialog()
# dialog.setTitle("mittudomen?")
dialog.show()
app.exec_()

(PySide2/Qt 5.15.2 and system-hotkey 1.0.3 are involved)

@brezniczky brezniczky changed the title Ubuntu 21 problem Ubuntu 21 globality problem Jul 9, 2021
@brezniczky
Copy link
Author

All right, sorry. I have began to process the information that Ubuntu 21 is based on Wayland, and Wayland does not - for security considerations - allow client applications to register global hotkeys.

I would like to hold myself back from commenting on how this is carried out by the Wayland maintainers (?), and for how long, but I expect that probably there won't be any solution in the scope of the system-hotkey package for this too soon.

Anyway, many thanks for the package so far!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant