Hey ,
I read this today , so great have your idea about this topic. just update
to you guys what I found , I think in most of case we just want to make the
hotkey available in view port , so I did a modification which only assign
the tab hotkey in view port instead of replace everything in whole maya
application .
It's working good without touch node editor or textField , have fun:
import maya.cmds as cmd
import maya.OpenMayaUI as mui
from shiboken2 import wrapInstance
from PySide2.QtGui import *
from PySide2.QtCore import *
from PySide2.QtWidgets import *
def tab_key_test():
cmd.polyCube()
### get main panel from name
MainPane = wrapInstance(long(mui.MQtUtil.findLayout('MainPane')) , QWidget )
### create q action
action = QAction(MainPane)
### set short cut key to tab
action.setShortcut(QKeySequence(Qt.Key_Tab))
### set context to whildren of MainPane
action.setShortcutContext(Qt.WidgetWithChildrenShortcut)
### connect to custom function
action.triggered.connect(tab_key_test)
### add action to widget
MainPane.addAction(action)
Best ,
在 2012年11月5日星期一 UTC+8下午11:36:02,Marcus Ottosson写道:
>
> Maya doesn't seem to support it via it's hotkey editor. I'm a Qt user and
> have tried taking ownership of the tab key via overriding maya's own
> keyPressEvent() without luck, I suspect it might work in versions prior to
> 2013 though due to their own usage of the tab-key in the node editor,
> although I have yet to confirm this.
>
> Anyone have any ideas? Preferably I'd like to keep the native tab
> functionality of switching between text- and num-fields and only have it
> active when regular hotkeys are active.
>
> Best,
> Marcus
>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/c1148650-9bbf-4121-a81e-24254310c339%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.