Exemplo n.º 1
0
        Response handleInput(Point const &pt_local,bool inside) override
        {
            bool outside = !inside;

            if(!outside)
            {
                if(pressed.Get())
                {
                    if(pt_local.action == Point::Action::Release)
                    {
                        pressed = false;
                        m_list_cancel_history.clear();
                    }
                    m_list_cancel_history.push_back(pt_local);
                }
                else
                {
                    if(pt_local.action == Point::Action::Press)
                    {
                        pressed = true;
                        m_timer =
                                ks::MakeObject<ks::CallbackTimer>(
                                    m_scene->GetEventLoop(),
                                    Milliseconds(200),
                                    [this]{ this->cancelInputsBehindThisInputArea(); });
                        m_timer->SetRepeating(false);
                        m_timer->Start();
                        m_list_cancel_history.push_back(pt_local);
                    }
                }
            }

            // Always pass through
            return Response::Ignore;
        }