Hi all, I'm trying to detect when a mouse button is clicked anywhere in Maya as part of an event filter. I currently have this as an event filter:
from PySide2 import QtCore, QtWidgets
from shiboken2 import wrapInstance
from maya import OpenMayaUI
win_ptr = OpenMayaUI.MQtUtil.mainWindow()
win = wrapInstance(long(win_ptr), QtWidgets.QMainWindow)
class MyEventFilter(QtCore.QObject):
def eventFilter(self, watched, event):
print event.type(), watched, event
filter = MyEventFilter()
win.installEventFilter(filter)
But it doesn't seem to trap a mouse button press/release event (or at least I don't see it in the output). What am I missing from this in order to trap the mouse button events?
Thank you for your time,
Ravi
--
Where we have strong emotions, we're liable to fool ourselves - Carl Sagan