Below is sample code on how you check for double click mouse event.
class MyCustomOperator_s1 : public HPS::HandlesOperator{public:MyCustomOperator_s1(HPS::Canvas c) : canvas(c) {}bool OnMouseDown(HPS::MouseState const& in_state){
HPS::SegmentKey modelKey = canvas.GetFrontView().GetAttachedModel().GetSegmentKey();
modelKey.Subsegment("text").Flush();
modelKey.GetVisibilityControl().SetText(true);
if (in_state.GetActiveEvent().ClickCount != 2)
{
modelKey.Subsegment("text").InsertText(HPS::Point(0, 0, 0), "Double Click");
}
else
{
modelKey.Subsegment("text").InsertText(HPS::Point(0, 0, 0), "Single Click");
}
canvas.UpdateWithNotifier().Wait();
return true;
}
private:
HPS::Canvas canvas;
};
void CHPSView::OnUserCode4()
{
HPS::View myView = GetCanvas().GetFrontView();
MyCustomOperator_s1 * myOp = new MyCustomOperator_s1(GetCanvas());
GetCanvas().GetFrontView().GetOperatorControl().Pop();
GetCanvas().GetFrontView().GetOperatorControl().Push(myOp, Operator::Priority::High);
}