ESPHome 2025.5.0
Loading...
Searching...
No Matches
sdl_touchscreen.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef USE_HOST
4#include "../sdl_esphome.h"
6
7namespace esphome {
8namespace sdl {
9
11 public:
12 void setup() override {
13 this->x_raw_max_ = this->display_->get_width();
14 this->y_raw_max_ = this->display_->get_height();
15 }
16
17 void update_touches() override {
18 if (this->parent_->mouse_down) {
19 add_raw_touch_position_(0, this->parent_->mouse_x, this->parent_->mouse_y);
20 }
21 }
22};
23
24} // namespace sdl
25} // namespace esphome
26#endif
Helper class to easily give an object a parent of type T.
Definition helpers.h:538
virtual int get_height()
Get the calculated height of the display in pixels with rotation applied.
Definition display.h:218
virtual int get_width()
Get the calculated width of the display in pixels with rotation applied.
Definition display.h:216
void add_raw_touch_position_(uint8_t id, int16_t x_raw, int16_t y_raw, int16_t z_raw=0)
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7