I am wondering if it is possible to disable hotkeys while in a custom python viewer state. Here is my problem, I am trying to use the “t”, “r” and “e” onKeyEvent in my object level python viewer state, but the viewport hotkeys seem to catch them first and it switches to the translation, rotation or scaling tools. I tried with the onKeyTransitEvent and it does catch the “key down” event and I then return True to consume the key transition, but the viewport still switches to the corresponding transformation tool.
Would there be a way to use those keys or do hotkeys have priority over viewer states key events?
Unfortunately, some hotkeys like the ones you mention cannot be overridden by python states. The hotkey architecture is currently being reworked to fix these kinds of problems.
mabelzile Unfortunately, some hotkeys like the ones you mention cannot be overridden by python states. The hotkey architecture is currently being reworked to fix these kinds of problems.
mabelzile Unfortunately, some hotkeys like the ones you mention cannot be overridden by python states. The hotkey architecture is currently being reworked to fix these kinds of problems.
mabelzile Unfortunately, some hotkeys like the ones you mention cannot be overridden by python states. The hotkey architecture is currently being reworked to fix these kinds of problems.
this will override the delete key ("Del") when in your viewer state. "delete_point" is the key code and corresponds to the key code in "menu.addActionItem". when the user hits the delete key, the user will call what would normally be called when selecting the item from the right mouse button menu. "delete selected points" is the description, and and can be anything you would like. the important part is to use the correct key string, "Del" for delete, "UpArrow" for up arrow, "ENTER" for enter, etc...
kodra Is there an easy way to know which hotkeys are "free to use" by a Python state?
I did a little run through all the characters and the ones who seem to be "locked" are:
d (Displayoptions)
e (Scaletool)
j (ModifyChannels)
r (RotateTool)
s (VolatileSelectMode)
t (MoveTool)
w (Wireframe)
Andalsothesespecialcharacters`\ ?
I wish we could override these in python states!
Are you talking about H20?
while I don't have much experience with Pyhon States limitations I'd find it odd if these were still an issue especially since Car Rig Python State in H20 uses hotkeys like WASD for movement and they seem to work