vred shortcuts vs focus

vred shortcuts vs focus

marc.winter2
Advocate Advocate
830 Views
3 Replies
Message 1 of 4

vred shortcuts vs focus

marc.winter2
Advocate
Advocate

Hi,

If the renderwindow loses the focus, vred-keyboard-shortcuts stop working

(If renderwindow is docked shortcuts also workes if mainwindow has focus.)

 

In python scripts we are setting sometimes the focus back to renderview:

from PySide2 import QtCore
from PySide2 import QtWidgets
QtCore.QCoreApplication.instance().vrMainWindow.findChildren(QtWidgets.QWidget, 'Render')[1].setFocus()

This workes quite well.

But my problem is setting the focus back to a undocked, maybe fullscreen viewport.

Any ideas?

 

Best regards,

Marc

0 Likes
831 Views
3 Replies
Replies (3)
Message 2 of 4

marcus_fritzen
Autodesk
Autodesk

Hi,

VRED uses different kinds of short-cut contexts. Some are application short-cuts and some are not (e.g. window short-cuts). What are you trying to achieve? Are you triggering short-cuts in Python scripts?

Cheers,

Marcus



Marcus Fritzen
Principal Engineer
0 Likes
Message 3 of 4

marc.winter2
Advocate
Advocate

Hi Marcus,

in this case users wants to start variantSets with shortcuts.

This is combined with some extra script and gui, so the focus will leave the renderview.

And so the vsetShortcuts wont work anymore.

 

Btw. what is the best way to trigger short-cuts in Python scripts?

 

Best regards,

Marc

0 Likes
Message 4 of 4

marc.winter2
Advocate
Advocate

My current workaround is,

to remember the renderWidget, which i found in docked, windowed state.

So i can set the focus to it, even if it is undocked and maximized.

But this stops working if the user creates new renderwindows, closes renderwindows, .....

0 Likes