lvgl / lv_drivers

TFT and touch pad drivers for LVGL embedded GUI library
https://docs.lvgl.io/master/porting/index.html
MIT License
290 stars 309 forks source link

SDL + multiple display + touch is not working #267

Closed Viatorus closed 1 year ago

Viatorus commented 1 year ago

The support for touch events for SDL was added with: https://github.com/lvgl/lv_drivers/pull/97

The problem: We are using multiple lvgl display drivers which all are visible at the same time e.g.:

image

The inner display is our "most active" display.

But with last_x = LV_HOR_RES * event->tfinger.x / MONITOR_ZOOM; the touch coordinates are wrong.

I am not quit sure how to fix this at the moment. :/

Viatorus commented 1 year ago

I think the correct way would be to usage of SDL_HOR_RES and SDL_VER_RES. I think this was forgotten by refactoring.