On 02/03/2017 at 02:07, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R18 demo
Platform: Windows ;
Language(s) : C++ ;
---------
Hi,
I have simple ToolData based plugin class. I don't want to go into details but inside is something like multi-layer interaction with user and I need Right mouse button to switch between those layers.
So in my Message function I have reaction to MSG_TOOL_ASK:
Bool C4dUtilObj::Message(BaseDocument* doc,BaseContainer& data,Int32 type,void* t_data)
{
switch(type){
case MSG_TOOL_ASK:
{
ToolAskMsgData* ask = (ToolAskMsgData* )t_data; // cast nasty void*
ask->use_rightmouse = true; // we need right mouse button
ask->popup_allowed = false; // popup window is not allowed
return true;
}
break;
}
return ToolData::Message(doc,data,type,t_data);
}
And in MouseInput is something like this:
Bool C4dUtilObj::MouseInput(BaseDocument* doc, BaseContainer& data, BaseDraw* bd, EditorWindow* win, const BaseContainer& msg)
{
// this is called just once if I clicked twice in very short time
QUALIFIER qualifier = (QUALIFIER)msg.GetInt32(BFM_INPUT_QUALIFIER); // shift, ctrl, etc
switch(msg.GetInt32(BFM_INPUT_CHANNEL)){
case BFM_INPUT_MOUSERIGHT:
// some stuff
break;
}
return true;
}
The problem is when I click with right mouse button twice in very short time (like double click with right mouse) MouseInput is called just once and qualifier doesn't contain INPUT_DBLCLK flag. Even BFM_INPUT_DOUBLECLICK value in msg is false.
Please let me know if there is some solution how to get two MouseInput calls or just one with proper msg. It is important for fast work with my plugin. Thank you.