Tnx! I'll trylooo wrote:The frame-builder stuff is a macro I've done some time ago. ...
if you want you can try: https://bitbucket.org/looooo/beam
There was no reason for these keys. Tab is used in blender for switching between different editing modes, but I don't know if it is a good idea to use this key in qt.your examples work with start key "a" and TAB
is there a reason why you use these?
TAB is good for right hand mouse holders
what about COMMA for left handers
There is still this random interruption. I've tried a workaround with a QTimer but still sometimes the menue dissapears without releasing the pressed key. Maybe it's not the best idea to use it in this state.I want to use your idea inside my plugin manager to generate context sensitive toolsets.
are there known problems?
Code: Select all
from PySide import QtCore from PySide import QtGui mw=Gui.getMainWindow() views=mw.findChildren(QtGui.QMainWindow) views.metaObject().className() view=views class EventFilter(QtCore.QObject): def eventFilter(self, o, e): # http://doc.qt.io/qt-5/qevent.html z=str(e.type()) if z == 'PySide.QtCore.QEvent.Type.ChildAdded' or z == 'PySide.QtCore.QEvent.Type.ChildRemoved': return False FreeCAD.Console.PrintMessage("\n") FreeCAD.Console.PrintMessage(e.type()) if z == 'PySide.QtCore.QEvent.Type.HoverMove' : # http://doc.qt.io/qt-5/qhoverevent.html FreeCAD.Console.PrintMessage("\n") FreeCAD.Console.PrintMessage(e.oldPos()) FreeCAD.Console.PrintMessage(e.pos()) FreeCAD.Console.PrintMessage("\n") # selection activities if z=="PySide.QtCore.QEvent.Type.MouseButtonPress": FreeCAD.Console.PrintMessage("pressed \n") if z=="PySide.QtCore.QEvent.Type.MouseButtonRelease": FreeCAD.Console.PrintMessage("released \n") return False ef=EventFilter() view.installEventFilter(ef) # To check if a new mdi view was created you have to get access to QMdiArea and set an even filter for QEvent.Type.ChildAdded. mw=Gui.getMainWindow() mdi=mw.findChild(QtGui.QMdiArea) mdi.installEventFilter(ef)
Code: Select all
workfeature: shortkeys: lineCutsPlane: selection: .edge .face exec: Msg("Create a point at the intersection of the Line and Plane selected.") projectPointToLine: selection: .edge .vertex exec: Msg("Create a projection Point of a Point onto a Line and symmetric point") name of the action: selection: [objectType].subObjectType ... exec: yourCommand() # objectType can be optional - no means all types # but so I can restrict some commands to special objects (example DWire Sketch )
Sounds interesting. And I think microelly2 has already shown how to do it.Do you think we can merge the 2 tools to give contextual tools depending on :
- where is the pointer on the view and
- what are the selected objects
press the key for the pie-menu and move the mouse for some time. The problem occurs only on my old laptop. So maybe this isn't an issue for you.Can you describe the "random interruption"
How I can reproduce its?
looo wrote:That is the plan. One global menu for wb.switch and one locale menu for every workbench. The problem is, that it is too heavy and buggy in this state and I don't know how to improve that. One thing is that background events sometimes close the window, or maybe that is a problem with the autorepeat option of the keyevent. The other thing is the key down suppress of the draft wb...
Here is a short demo of the menu connected with some framebuild functionality in action.