0

Is there any way to achieve hot-plugging of USB mouse in DirectFB 1.2.9 or Qt Embedded 4.7.3?

Currently my application stack is thus..

 -----------------
       GUI
 -----------------
 Qt Embedded 4.7.3
 -----------------
   DirectFB 1.2.9
 -----------------
 /dev/input/eventX
 -----------------

DirectFB opens the Linux input device node. Qt uses a QSocketNotifier to wait on the DirectFB event buffer and sets up a slot to read the mouse data. But on hot-plugging, DirectFB does not open the device node and no mouse events are generated.

As far as I understand so far, hot-plugging is not supported by DirectFb..

I tried disabling DirectFB's handling of the Linux input device (removing the dev node from linux-input-devices= option in directfbrc), and set QWS_MOUSE_PROTO="linuxinput:.." but this did not work for some reason. Seems no mouse events were generated. Even if I manage to get it to work, I don't think QT provides any support for hot-plugging either.

So is my only alternative to sub-class QMouseDriverPlugin and QWSMouseHandle classes?. For this, I am yet to figure out how to make QT use the sub-classes I implement. i.e, Once I implement these classes how do I link them into the QT input device handling frame-work, so that I can set something like QWS_MOUSE_PROTO="mylinuxinput:.."?

Ajith
  • 613
  • 1
  • 15
  • 32
  • Managed to get the mouse working directly from QT with QWS_MOUSE_PROTO. But as expected no hot-plugging. – Ajith Dec 21 '12 at 06:57

1 Answers1

1

As far as I can remember, I encountered no issue with mouse or keyboard hotplugging in Qt Embedded 4.7.2 (without DirectFB). If you want to subclass yourself, modify the plugin starting from the linuxinput plugin. You'll find that in Qt sources: this is the directory where the plugins are placed, but some classes are included in other directories.

Also, are you getting data in your linux device after pluggin in? Did you try to cat the device?

Luca Carlon
  • 9,546
  • 13
  • 59
  • 91
  • Then you might want to have a look at the code and debug instead of rewriting. – Luca Carlon Dec 21 '12 at 07:40
  • Sorry should have been more clear in my first comment. Although I can cat.. once I up-plug the mouse, cat will exit. The device node no longer exists.. I need to cat again after plugging in. The device node is dynamically managed by udev. – Ajith Dec 21 '12 at 08:11
  • 1
    What is important is that you can cat after plugging in again. In that case it means the lower level is ok. Try to debug the Qt plugin to see why it is not getting data when plugging in again. – Luca Carlon Dec 21 '12 at 08:41