On 28/12/2015 at 18:39, xxxxxxxx wrote:
Hi Sebastian,
I know that was a little old, but I reworked the code and did many tests to see where the problem is.
now what I can confirm: (attached a piece of the code..)
Bool SNodeUserArea::InputEvent(const BaseContainer& msg)
{
Int32 dev = msg.GetInt32(BFM_INPUT_DEVICE);
Int32 chn = msg.GetInt32(BFM_INPUT_CHANNEL);
GePrint("any event!!");
if (dev == BFM_INPUT_KEYBOARD)
{
GePrint("any key is pressed");
if(chn == KEY_DELETE)
{
if (!selection)
return true;
BaseContainer actionk(BFM_ACTION);
actionk.SetInt32(BFM_ACTION_ID, GetId());
actionk.SetInt32(BFM_ACTION_VALUE, 0);
actionk.SetInt32(BFM_ACTION_UPDATE, true);
removeSelectedNodes();
removeSelectedWires();
//InvokeCommandCall(GetDialog(), COMMANDMSG_VALUECHANGED, actionk);
SendParentMessage(actionk);
return true;
}
}
......
the problem is:
after a mouse click "for example selecting a node in my userarea" , this changes the data of my CustomDataType, once this is done, the focus is gone!
so next keyboard hit is missing "the whole InputEvent() is not called at all!" , so I have to click again.
I also tested it with your example, your example works fine!, the only difference that I see is: in many cases I may send multiple parent messages... "is this a problem?"
though I hacked around it, not sure if this is fine or not "you may tell " , I set:
action.SetInt32(BFM_ACTION_UPDATE, true);
this forced it to work! , so if this is fine you can consider this solved or suggest a better alternative