diff --git a/src/lua/bindings/input.cpp b/src/lua/bindings/input.cpp index cc2954a..279eccc 100644 --- a/src/lua/bindings/input.cpp +++ b/src/lua/bindings/input.cpp @@ -25,8 +25,8 @@ static int l_input_getRawTouch(lua_State* L) { return 1; } TS_Point point = owner->touch.getPoint(); - lua_pushinteger(L, point.x); lua_pushinteger(L, point.y); + lua_pushinteger(L, point.x); return 2; } diff --git a/src/lua/lua_app.cpp b/src/lua/lua_app.cpp index 6c96546..9a57059 100644 --- a/src/lua/lua_app.cpp +++ b/src/lua/lua_app.cpp @@ -20,8 +20,8 @@ LuaApp* app(lua_State* L) { return *static_cast(lua_getextraspace(L)); void bindApp(lua_State* L, LuaApp* owner) { *static_cast(lua_getextraspace(L)) = owner; } void LuaApp::mapTouch(TFT_eSPI& tft, const TS_Point& p, int16_t& x, int16_t& y) { - int16_t nx = constrain(map(p.x, settings.touchX0, settings.touchX1, 0, PANEL_W), 0, PANEL_W - 1); - int16_t ny = constrain(map(p.y, settings.touchY0, settings.touchY1, 0, PANEL_H), 0, PANEL_H - 1); + int16_t nx = constrain(map(p.y, settings.touchX0, settings.touchX1, 0, PANEL_W), 0, PANEL_W - 1); + int16_t ny = constrain(map(p.x, settings.touchY0, settings.touchY1, 0, PANEL_H), 0, PANEL_H - 1); switch (tft.getRotation() & 3) { case 1: x = PANEL_H - 1 - ny; diff --git a/src/settings.h b/src/settings.h index 0284320..9899b6c 100644 --- a/src/settings.h +++ b/src/settings.h @@ -6,7 +6,7 @@ // Persisted as a Lua table literal in /settings.lua: the firmware already links // Lua, so this needs no parser, and Lua apps can read the file with load(). struct Settings { - int16_t touchX0 = 200, touchY0 = 240, touchX1 = 3800, touchY1 = 3800; + int16_t touchX0 = 240, touchY0 = 3800, touchX1 = 3800, touchY1 = 200; // Degrees clockwise, stored for humans editing the file; TFT_eSPI wants 0-3. int16_t rotation = 0; String wifiSsid;