I am trying to implement a new keyboard driver for a HW we have designed. It's like a PDA with 3 buttons. I get the buttons from the Linux kernel with keycodes 0x01, 0x02 and 0x03. I have made a new driver based on the "qkbdvr41xx_qws.h/.cpp" and made changes in the qkbddriverfactory_qws.cpp file (under src/embedded) in addition i made changes in the qt_embedded.pri file in order to compile the new driver. I then configure it in and make the embedded library (I make it static) . I make my program link it static again and try to run it.
The changes I made in some detail:
First I have an application that works when compiled with QT on Suse 9.1. The application also runs on the board, but do not receive keyboard events. It receives mouse event trough a touch screen.
I made a copy of the qkbdvr41xx_qws.h/.cpp files and reduced the number of buttons and opend /dev/keypad as I am using as driver.
So what I need to do is to get this new driver to be linked in staticaly in to the libqte.a and link my application against it. And that part is ok. The problem is that the new driver (class) does not get created at run time. (I check by adding qDebug/qWarning messags in the code)
I have added my new driver in the qkbddriverfactory_qws.cpp as
In QKbdDriverFactory::create metod I added:
#ifndef QT_NO_QWS_KBD_HF
if ( driver == "hf" || driver.isEmpty() )
return new QWSHFbuttonsKeyboardHandler( device );
#endif
and in QKbdDriverFactory::keys method I added:
#ifndef QT_NO_QWS_KBD_HF
if ( !list.contains( "HF" ) )
list << "HF";
#endif
In qt-embedded.pri I added
contains( kbd-drivers, hf ) {
HEADERS +=$$EMBEDDED_H/qhfbuttons.h
SOURCES +=$$EMBEDDED_CPP/qhfbuttons.cpp
}
else: DEFINES += QT_NO_QWS_KBD_HF
This is working because I get the driver compiled.
No luck so far. Any ideas.