How to detect keypresses inside FreeCAD window without creating a qt widget
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
How to detect keypresses inside FreeCAD window without creating a qt widget
I've seen that a lot of macros use pyside and I know Qt's "mainwindow" class has a key-press event handler inside it, is there a way to detect key-presses inside the FreeCAD window like you can with other apps that have without having to create a new qt widget?
-
- Veteran
- Posts: 3106
- Joined: Thu Sep 24, 2020 10:31 pm
- Location: Hawaii
- Contact:
Re: How to detect keypresses inside FreeCAD window without creating a qt widget
You can install an eventFilter in the QApplication. However, depending on your exact Qt version, there were bugs in PySide2 that would crash FreeCAD in such a situation.
Re: How to detect keypresses inside FreeCAD window without creating a qt widget
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
My macros on Gist.github here complete macros Wiki and forum.