Coder Social home page Coder Social logo

Touch pad is unresponsive about lv_port_linux HOT 15 CLOSED

Uup115 avatar Uup115 commented on July 29, 2024
Touch pad is unresponsive

from lv_port_linux.

Comments (15)

Uup115 avatar Uup115 commented on July 29, 2024 1

Yes, from the X window console command prompt, I ran evtest many times yesterday. No issues. Touch events fire successfully.

However, now that you mention it... Perhaps, I should run evtest within the virtual console (Ctrl + Alt + F1). This is where ./demo actually runs. I'll try this, later this evening, and report back.

from lv_port_linux.

embeddedt avatar embeddedt commented on July 29, 2024

Does the application crash, or does it just hang? Do you have the ability to debug using GDB?

from lv_port_linux.

Uup115 avatar Uup115 commented on July 29, 2024

The application doesn't crash or hang. The text box cursor keeps blinking and the spinner (bottom left) keeps spinning. As soon as I put my finger on the touch pad, the touch pad cursor simply disappears and the touch pad buttons no longer work.

GDB also shows no evidence of hanging. I've attached the project for your reference. I must run as sudo ./demo. Otherwise, permission is denied for "evdev" interface.

Best Regards

lv_linux_frame_buffer_Uup115.tar.gz

from lv_port_linux.

embeddedt avatar embeddedt commented on July 29, 2024

Can you run evtest <your input device>? What happens there when you put your finger on the touchpad? Do the events stop firing?

from lv_port_linux.

Uup115 avatar Uup115 commented on July 29, 2024

Within the virtual console (Ctrl + Alt + F1), I ran sudo evtest /dev/input/event5. ALL touch pad events fire successfully. No issues.

from lv_port_linux.

kisvegabor avatar kisvegabor commented on July 29, 2024

Could you printf the coordinates passed to LittlevGL libinput_read?

from lv_port_linux.

embeddedt avatar embeddedt commented on July 29, 2024

@kisvegabor I think he is using evdev_read, not libinput_read.

from lv_port_linux.

kisvegabor avatar kisvegabor commented on July 29, 2024

@embeddedt

I think he is using evdev_read, not libinput_read.

My bad, sorry. I meant evdev_read.

from lv_port_linux.

Uup115 avatar Uup115 commented on July 29, 2024

Thanks to both of you for the insight!

It seems the touch pad's coordinates don't begin at zero for X & Y (something that never crossed my mind). Lines 208 - 211 of evdev.c are forcing the x & y data points outside (below) the touch pad's active coordinate range (x: 799, y: 479; which equals the frame's dimensions - 1).

if(data->point.x >= lv_disp_get_hor_res(drv->disp))
      data->point.x = lv_disp_get_hor_res(drv->disp) - 1;
if(data->point.y >= lv_disp_get_ver_res(drv->disp))
      data->point.y = lv_disp_get_ver_res(drv->disp) - 1;

In this case, scaling is needed. I expect calibration will also be needed, to keep the touch pad's cursor from moving outside of the frame. Scaling and Calibration can be adjusted within lv_drv_conf.h (lines 282 - 294):

#  define EVDEV_SCALE             0               /* Scale input, e.g. if touchscreen resolution does not match display resolution */
#  if EVDEV_SCALE
#    define EVDEV_SCALE_HOR_RES     (4096)          /* Horizontal resolution of touchscreen */
#    define EVDEV_SCALE_VER_RES     (4096)          /* Vertical resolution of touchscreen */
#  endif  /*EVDEV_SCALE*/

#  define EVDEV_CALIBRATE         0               /*Scale and offset the touchscreen coordinates by using maximum and minimum values for each axis*/
#  if EVDEV_CALIBRATE
#    define EVDEV_HOR_MIN   3800                    /*If EVDEV_XXX_MIN > EVDEV_XXX_MAX the XXX axis is automatically inverted*/
#    define EVDEV_HOR_MAX   200
#    define EVDEV_VER_MIN   200
#    define EVDEV_VER_MAX   3800
#  endif  /*EVDEV_SCALE*/

Is this the direction I should take, or should I do something else?

from lv_port_linux.

kisvegabor avatar kisvegabor commented on July 29, 2024

You should check raw the min max coordinates (e.g. printf them) and use them in EVDEV_HOR/VER_MIN/MAX.

from lv_port_linux.

Uup115 avatar Uup115 commented on July 29, 2024

I now have the touch pad working! However, as the code is written, it's functioning similar to a touch screen, rather than a mouse. Not a problem though. I plan to use a touch screen anyway.

Thanks again, to the both of you, for the excellent support and learning experience!

from lv_port_linux.

kisvegabor avatar kisvegabor commented on July 29, 2024

Glad to hear that it works!

from lv_port_linux.

Shabina-dotcom avatar Shabina-dotcom commented on July 29, 2024

Can you help me, I am also facing same issue.

from lv_port_linux.

Uup115 avatar Uup115 commented on July 29, 2024

Have you tried the tutorial? It's a challenge to get it working. What specifically are you having trouble with?

from lv_port_linux.

Shabina-dotcom avatar Shabina-dotcom commented on July 29, 2024

Have you tried the tutorial? It's a challenge to get it working. What specifically are you having trouble with?

I developed UI which is responsive in Display monitor using mouse, Same UI, I wanted to use with touch panel. But it is not responsive (touch is not working). I am using 1024x600 TFT LCD Display with capacitive touch panel. (Touch Screen Controller FT5406).

from lv_port_linux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.