By default pressing the RightMouseButton in an editor view will show a popup menu. I would want to be able to trigger something similar, but without removing the possibility to trigger the default popup menu with RMB.
For this reason I came up with the combination of CTRL + RMB, which I detect in my SceneHook::MouseInput (as follows):
if (msg.GetInt32(BFM_INPUT_CHANNEL) == BFM_INPUT_MOUSERIGHT)
{
BaseContainer keyChannels;
if (GetInputEvent(BFM_INPUT_KEYBOARD, keyChannels))
{
Bool ctrlModifier = (keyChannels.GetInt32(BFM_INPUT_QUALIFIER) & QCTRL) != 0;
if (ctrlModifier)
{
ApplicationOutput("SceneHook - MouseInput: RMB + CTRL was pressed");
return true;
}
}
}
This is working fine when a move, rotate, scale tool is active. Even when an own custom created DescriptionTool plugin is active.
However, when the Live Selection tool is active, the code is not triggered.
At least not with the default "EXECUTIONPRIORITY_INITIAL" (=value 1000) I had provided when registering my scenehook plugin.
When I provide "EXECUTIONPRIORITY_ANIMATION (=value 2000) only then does the code get triggered, also when Live Selection tool is active.
return RegisterSceneHookPlugin(MY_SCENEHOOK_PLUGIN_ID, GeLoadString(IDS_MY_SCENEHOOK), 0, MySceneHook::Alloc, EXECUTIONPRIORITY_ANIMATION, 0);
Any value below 2000 just ignores to trigger the code when Live Selection tool is active.
Now, I can understand this is probably not a bug, but made on purpose. But why?
Why would the Live Selection tool have more "priority" then any other tool?
Note:
I am prototyping this with R20 (on Windows). Have not yet tested with later versions. Nor tried on macOS.