42 lines
957 B
C++
42 lines
957 B
C++
/*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "Gesture.hpp"
|
|
#include "Touch.hpp"
|
|
#include "GestureInfos.hpp"
|
|
#include "Base/Event.hpp"
|
|
#include <map>
|
|
|
|
namespace OpenVulkano::Input
|
|
{
|
|
class GestureTap final : public Gesture
|
|
{
|
|
std::chrono::time_point<std::chrono::steady_clock> m_startTime;
|
|
float m_distance;
|
|
Math::Vector2f m_initialPoint;
|
|
std::map<TouchId, bool> m_touchMap;
|
|
TapInfo m_tapInfo;
|
|
|
|
int GetTouchCount() const;
|
|
|
|
public:
|
|
GestureTap() : Gesture(TYPE_TAP) {}
|
|
|
|
~GestureTap() override = default;
|
|
|
|
void Cancel() override;
|
|
|
|
void Reset() override;
|
|
|
|
void TouchDown(const Touch& touch) override;
|
|
void TouchUp(const Touch& touch) override;
|
|
void TouchMoved(const Touch& touch) override;
|
|
|
|
Event<const GestureTap*, const TapInfo&> OnTap;
|
|
};
|
|
} |