Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED] Problem reading simulated touch events from /dev/input/event1
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Problem reading simulated touch events from /dev/input/event1

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 3 Posters 5.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aekam
    wrote on 14 May 2013, 12:07 last edited by
    #1

    Hello All,
    I have created GUI application for my custom board.
    with environment variable export QWS_MOUSE_PROTO=tslib:/dev/input/event0 it works fine for manual touch.

    Now i wanted to create simulation of frequent touch events for application testing.
    So I created one test application which creates touch events and writes in /dev/uinput and this events are automatically re-directed by kernel to /dev/input/event1. Now starts the problem that I can see event by cat /dev/input/event1 but application doesn't get any.

    Any hint, clue, solution.?

    If you take care of inches, you won't have to worry about miles... :)

    1 Reply Last reply
    0
    • A Offline
      A Offline
      aekam
      wrote on 15 May 2013, 04:10 last edited by
      #2

      Hello Guys...
      Found an error in my simulator code.
      Actually I was writing touch release event as...
      @
      struct input_event ev_release[] =
      {
      {{ 0, 0 }, EV_KEY, BTN_TOUCH, 0 }
      };
      @

      I changed above piece of code to...
      @
      struct input_event ev_release[] =
      {
      { { 0, 0 }, EV_KEY, BTN_TOUCH, 0 },
      { { 0, 0 }, EV_ABS, ABS_X, x },
      { { 0, 0 }, EV_ABS, ABS_Y, y },
      { { 0, 0 }, EV_ABS, ABS_PRESSURE, p },
      { { 0, 0 }, EV_SYN, SYN_REPORT, 0 },
      };
      @

      ... and it worked. :)

      So maybe Qt doesn't accept touch/mouse events without coordinates, I assume.
      Correct me if I am wrong.

      If you take care of inches, you won't have to worry about miles... :)

      E 1 Reply Last reply 19 Oct 2018, 11:34
      0
      • A Offline
        A Offline
        ArunkumarRavi
        wrote on 29 Aug 2014, 08:48 last edited by
        #3

        Hi aekam,
        Currently im in a similar situation of simulating touch events by emulating the touch co-ordiantes into the driver.. im new to QT and drivers.. Saw this post as solved,Hence requesting you to help me

        1 Reply Last reply
        0
        • A aekam
          15 May 2013, 04:10

          Hello Guys...
          Found an error in my simulator code.
          Actually I was writing touch release event as...
          @
          struct input_event ev_release[] =
          {
          {{ 0, 0 }, EV_KEY, BTN_TOUCH, 0 }
          };
          @

          I changed above piece of code to...
          @
          struct input_event ev_release[] =
          {
          { { 0, 0 }, EV_KEY, BTN_TOUCH, 0 },
          { { 0, 0 }, EV_ABS, ABS_X, x },
          { { 0, 0 }, EV_ABS, ABS_Y, y },
          { { 0, 0 }, EV_ABS, ABS_PRESSURE, p },
          { { 0, 0 }, EV_SYN, SYN_REPORT, 0 },
          };
          @

          ... and it worked. :)

          So maybe Qt doesn't accept touch/mouse events without coordinates, I assume.
          Correct me if I am wrong.

          E Offline
          E Offline
          Edoardo1982
          wrote on 19 Oct 2018, 11:34 last edited by Edoardo1982
          #4

          @aekam Hi,
          I'm working with uinput to simulate a touch driver using embedded linux on sama board.
          I set TSLIB_TSDEVICE=/dev/input/event0, but QT seems not working.
          I can see event by cat /dev/input/event0 but application doesn't get any.
          My question is: why do you have a release event?
          My code is

          emit(fd, EV_KEY, BTN_TOUCH, 1);
          emit(fd, EV_ABS, ABS_X, point.x);
          emit(fd, EV_ABS, ABS_Y, point.y);
          emit(fd, EV_SYN, SYN_REPORT, 0);
          

          where emit is defined

          void emit(int fd, int type, int code, int val) {
          struct input_event ie;
          ie.type = type;
          ie.code = code;
          ie.value = val;
          write(fd, &ie, sizeof(ie));
          }

          Any help is greatly appreciated.

          Thanks

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved