Hi all,
I'm trying get a eventFilter to work and get the keyboard press event,
it works fine for me with mouse events but I can't get the keyboard events to
work,
i guess I'm missing something,
this is the far I got:
import sip
import maya.OpenMayaUI as OpenMayaUI
from PyQt4 import QtGui, QtCore
class MouseEventFilter(QtCore.QObject):
def eventFilter(self, obj, event):
if event.type() == QtCore.QEvent.KeyPress:
print "working..."
return True
return False
view = OpenMayaUI.M3dView.active3dView()
widget = sip.wrapinstance(long(view.widget()), QtCore.QObject)
eventFilter = MouseEventFilter(widget)
widget.installEventFilter(eventFilter)
#widget.removeEventFilter(eventFilter)
problem is that the QtCore.QEvent.KeyPress never happends =/
any ideas why??
thnaks!
Luiz
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.