diff options
| author | JF <jf@codingfield.com> | 2021-09-02 18:35:56 (GMT) |
|---|---|---|
| committer | Gitea <gitea@fake.local> | 2021-09-02 18:35:56 (GMT) |
| commit | 6c3d6fb2575888e582e7ef3004a0bc3bf6c588b6 (patch) | |
| tree | ac396c060b423dd98fd915e742c14fc457a6f6d9 /src/touchhandler/TouchHandler.h | |
| parent | db6a701644116932f11c54ee0f619464de9faeb7 (diff) | |
| parent | 6f9f0e8b0e42a5526d47ca664534fb6b0ccb6ace (diff) | |
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/touchhandler/TouchHandler.h')
| -rw-r--r-- | src/touchhandler/TouchHandler.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/touchhandler/TouchHandler.h b/src/touchhandler/TouchHandler.h new file mode 100644 index 0000000..f544293 --- /dev/null +++ b/src/touchhandler/TouchHandler.h @@ -0,0 +1,45 @@ +#pragma once +#include "drivers/Cst816s.h" +#include "systemtask/SystemTask.h" +#include <FreeRTOS.h> +#include <task.h> + +namespace Pinetime { + namespace Components { + class LittleVgl; + } + namespace Drivers { + class Cst816S; + } + namespace System { + class SystemTask; + } + namespace Controllers { + class TouchHandler { + public: + explicit TouchHandler(Drivers::Cst816S&, Components::LittleVgl&); + void CancelTap(); + bool GetNewTouchInfo(); + void UpdateLvglTouchPoint(); + + bool IsTouching() const { + return info.touching; + } + uint8_t GetX() const { + return info.x; + } + uint8_t GetY() const { + return info.y; + } + Drivers::Cst816S::Gestures GestureGet(); + private: + + Pinetime::Drivers::Cst816S::TouchInfos info; + Pinetime::Drivers::Cst816S& touchPanel; + Pinetime::Components::LittleVgl& lvgl; + Pinetime::Drivers::Cst816S::Gestures gesture; + bool isCancelled = false; + bool gestureReleased = true; + }; + } +} |
