#pragma once #include #include "Wire.h" #include "emu_input.h" /** * Touch shim: left mouse button on the canvas acts as a GT911 touch tap. */ class TouchDrvGT911 { public: void setPins(int, int) {} bool begin(TwoWire &) { return true; } bool begin(TwoWire &, uint8_t) { return true; } void setMaxCoordinates(int, int) {} void setSwapXY(bool) {} void setMirrorXY(bool, bool) {} void sleep() {} bool isPressed() { return emu::touchDown; } uint8_t getPoint(int16_t *x, int16_t *y, uint8_t n) { if (n == 0 || !emu::touchDown) return 0; x[0] = (int16_t)emu::touchX; y[0] = (int16_t)emu::touchY; return 1; } };