codito / pyqtkeybind

Global hotkey bindings for Windows and Linux for PyQt apps
MIT License
60 stars 10 forks source link

Is there any plan to update this module to support PYQT6? #29

Open valuex opened 1 year ago

valuex commented 1 year ago

Thanks for sharing this module. Is there any plan to update this module to support PYQT6?

codito commented 1 year ago

@valuex sorry, there is no plan due to lack of bandwidth :( Happy to accept patches if anyone from community is willing to contribute.

damonlynch commented 1 year ago

I presume you would be okay with simultaneously adding support for the QtPy abstraction layer? That would make the project enhancement more attractive.

codito commented 1 year ago

@damonlynch yes, QtPy will be a great addition!

I believe some of the core APIs around native event handlers have changed across PyQt5 to PyQt6. Hopefully QtPy may already have a common abstraction for these. For reference, here are differences from the C++ equivalent of this library: https://github.com/Skycoder42/QHotkey/blob/master/QHotkey/qhotkey_x11.cpp (search for QT_VERSION).

codito commented 11 months ago

https://github.com/codito/pyqtkeybind/pull/30 helped add Windows support for PyQt6 (thanks damonlynch@).

Re X11, I think we're blocked on availability of an API to get the underlying X11 connection (QGuiApplication.nativeInterface, see this commit in QtBase). I tried creating another connection with xcffib.connect() but the GrabKey fails for this. If anyone has additional ideas to explore, please suggest.

damonlynch commented 9 months ago

@codito regarding X11, this code may (or may not) be relevant:

https://github.com/retext-project/retext/blob/master/ReText/xsettings.py

The developer of that code is highly-skilled. He is the PyQt packager for Debian.

It's GPL so cannot be dropped-in to this project. However, it may suggest a way forward? I don't know. X is far from my area of expertise.