[Qt-interest] [solved] [Qt-embedded-interest] multiple keyboard support with LinuxInput driver?

Jeroen De Wachter jeroen.dewachter at barco.com
Wed Mar 10 15:33:19 CET 2010


Hello again,

For the (no doubt) countless souls amongst you searching on my problem, 
you need no longer bother.

I have found a workable solution. It seems there is no limit to the 
number of QWSKeyboardHandlers that can be active at any given moment. 
The QWSKeyboardHandler used in QWSServer is only the primary one. Extra 
QWSKeyboardHandlers can be instantiated by calling 
QKbdDriverFactory::create with the proper arguments.

For instance: QKbdDriverFactory::create("LinuxInput", "/dev/event2");

So even though the returned QWSKeyboardHandlers is not registered with 
the QWSServer, it still passes its key inputs along to the QWSServer.
You do need to delete any handler you create this way though.

We'll likely integrate this with mdev / inotify and create/delete the 
QWSKeyboardHandler instances as we need them.

Kind regards,

Jeroen De Wachter


Jeroen De Wachter wrote:
> Hi,
>
> I'm working on an embedded PowerPC device.
> There is a control box attached to the device through USB. That box acts 
> like a standard keyboard, and the LinuxInput driver gets its input 
> without issue.
>
> However, we will have situations where more than one control box is 
> attached. In that case, there will be one device file per control box. 
> This is a problem as the LinuxInput Keyboard handler only processes one 
> device file and QWSServer only has one QWSKeyboardHandler to work with.
>
> Is there any standard way of dealing with an arbitrary number of input 
> devices? Or do we need to write our own KeyboardHandler to do this? This 
> seems like something someone must have already encountered (and 
> hopefully solved ;) ).
>
> We are considering an implementation based on either mdev (a simpler 
> version of udev) or inotify, which would notify the KeyBoardHandler when 
> an input device is connected or disconnected.
>
> Using X is not an option for us, considering our limited hardware 
> (especially storage and memory).
>
> Thx,
>
> Jeroen De Wachter
>
> _______________________________________________
> Qt-embedded-interest mailing list
> Qt-embedded-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-embedded-interest
>
>   





More information about the Qt-interest-old mailing list