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] Send generated MouseEvents to Kernel event / DirectFB linux_input event

[Solved] Send generated MouseEvents to Kernel event / DirectFB linux_input event

Scheduled Pinned Locked Moved Mobile and Embedded
mouseeventdirectfbevent
4 Posts 2 Posters 1.9k Views
  • 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.
  • M Offline
    M Offline
    McLion
    wrote on 26 Jun 2015, 09:39 last edited by McLion
    #1

    Hi

    I am trying to generate mouse events.
    It basically works, but I am still missing some part.

    I use this to set the position:

    QCursor *cur = new QCursor; cur->setPos(pXY); 
    

    and this to post the event:

    QApplication::postEvent(this, new QMouseEvent(MB_Event, pXY, MB_Button, 0, 0));
    

    This positions and executes a click at the given location. Using postEvent alone does the click but always at position 0,0.
    However, the mouse cursor always stays at the same location (middle of screen).
    This seems to be because the mouse cursor is displayed by DirectFB and the above MouseEvents obviously never make it to DirectFB. I am not sure this is completely true because I can override the look of the cursor in Qt, but I could not find to set it's position.

    Instead of doing the above, I am now trying to send an event to the Kernel or to the linux_input of DFB. This would then position the cursor and the event would automatically be propagated to Qt.

    Any idea how this can be done?
    Thanks

    1 Reply Last reply
    0
    • M Offline
      M Offline
      McLion
      wrote on 29 Jun 2015, 06:29 last edited by
      #2

      Nobody a hint on this ... or maybe a hint where to ask.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tomma
        wrote on 29 Jun 2015, 11:54 last edited by
        #3

        I think on Linux, easiest way is using uinput (http://thiemonge.org/getting-started-with-uinput)

        M 1 Reply Last reply 30 Jun 2015, 12:45
        1
        • T tomma
          29 Jun 2015, 11:54

          I think on Linux, easiest way is using uinput (http://thiemonge.org/getting-started-with-uinput)

          M Offline
          M Offline
          McLion
          wrote on 30 Jun 2015, 12:45 last edited by
          #4

          @tomma

          Thanks a lot! That was great input.
          While reading about uinput the idea of writing to the event itself instead crossed me.
          I implemented a function that generates the various (basic) events of a touch screen and writing it directly to event0.
          It works perfect so far.

          1 Reply Last reply
          0

          4/4

          30 Jun 2015, 12:45

          • Login

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