|
|
@ -68,6 +68,7 @@ uint8_t TouchButtons::read_buttons() { |
|
|
|
#ifdef HAS_WIRED_LCD |
|
|
|
int16_t x, y; |
|
|
|
|
|
|
|
#if ENABLED(TFT_TOUCH_DEVICE_XPT2046) |
|
|
|
const bool is_touched = (TERN(TOUCH_SCREEN_CALIBRATION, touch_calibration.calibration.orientation, TOUCH_ORIENTATION) == TOUCH_PORTRAIT ? touchIO.getRawPoint(&y, &x) : touchIO.getRawPoint(&x, &y)); |
|
|
|
#if HAS_TOUCH_SLEEP |
|
|
|
if (is_touched) |
|
|
@ -89,6 +90,10 @@ uint8_t TouchButtons::read_buttons() { |
|
|
|
x = uint16_t((uint32_t(x) * TOUCH_CALIBRATION_X) >> 16) + TOUCH_OFFSET_X; |
|
|
|
y = uint16_t((uint32_t(y) * TOUCH_CALIBRATION_Y) >> 16) + TOUCH_OFFSET_Y; |
|
|
|
#endif |
|
|
|
#elif ENABLED(TFT_TOUCH_DEVICE_GT911) |
|
|
|
bool is_touched = (TOUCH_ORIENTATION == TOUCH_PORTRAIT ? touchIO.getPoint(&y, &x) : touchIO.getPoint(&x, &y)); |
|
|
|
if (!is_touched) return 0; |
|
|
|
#endif |
|
|
|
|
|
|
|
// Touch within the button area simulates an encoder button
|
|
|
|
if (y > BUTTON_AREA_TOP && y < BUTTON_AREA_BOT) |
|
|
|