42 #if !defined(QT_NO_QWS_KEYBOARD) && !defined(QT_NO_QWS_KBD_INTEGRITY) 48 #include <INTEGRITY.h> 50 #include <device/hiddriver.h> 136 void kbdDataAvailable(uint32_t
keycode,
bool pressed);
139 void readKeyboardData(uint32_t keycode,
bool pressed);
158 void stoploop() { loop =
false; ReleaseSemaphore(loopsem); };
177 Error driverError, deviceError;
184 driverError = gh_hid_get_driver(i, &driver);
188 deviceError = gh_hid_init_device(driver, j, &handle);
192 deviceError = gh_hid_get_setting(handle, HID_SETTING_CAPABILITIES, &type);
193 if ((deviceError ==
Success) && !(type & HID_TYPE_AXIS)) {
194 handleList.append(handle);
197 gh_hid_close(handle);
200 }
while (deviceError ==
Success);
203 }
while (driverError ==
Success);
204 return (devices > 0);
214 Qt::KeyboardModifiers keymod;
220 foreach (HIDHandle h, handleList) {
221 CheckSuccess(CreateActivity(CurrentTask(), 2,
false, i, &act));
224 CheckSuccess(gh_hid_async_wait_for_event(h, act));
228 CheckSuccess(CreateSemaphore(0, &loopsem));
229 CheckSuccess(CreateActivity(CurrentTask(), 2,
false, 0, &loopact));
230 CheckSuccess(AsynchronousReceive(loopact, (
Object)loopsem, NULL));
235 uint32_t num_events = 1;
236 WaitForActivity(&
id);
238 while (gh_hid_get_event(handleList.at(
id), &
event, &num_events) ==
Success) {
239 if (event.type == HID_TYPE_KEY) {
240 switch (event.index) {
241 case HID_KEY_LEFTALT:
242 case HID_KEY_RIGHTALT:
248 case HID_KEY_LEFTSHIFT:
249 case HID_KEY_RIGHTSHIFT:
255 case HID_KEY_LEFTCTRL:
256 case HID_KEY_RIGHTCTRL:
272 imp->dataReady(event.index, event.value);
275 CheckSuccess(gh_hid_async_wait_for_event(handleList.at(
id), actList.at(
id)));
283 handler->processKeycode(keycode, pressed,
false);
290 qDebug(
"Opening INTEGRITY keyboard");
304 #include "qkbdintegrity_qws.moc" 306 #endif // QT_NO_QWS_KEYBOARD || QT_NO_QWS_KBD_TTY
friend class QIntKeyboardListenThread
The QWSKeyboardHandler class is a base class for keyboard drivers in Qt for Embedded Linux...
#define QT_END_NAMESPACE
This macro expands to.
void run()
The starting point for the thread.
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
The QChar class provides a 16-bit Unicode character.
static const struct KeyMapEntryStruct keyMap[]
Q_CORE_EXPORT void qDebug(const char *,...)
void readKeyboardData(uint32_t keycode, bool pressed)
#define QT_BEGIN_NAMESPACE
This macro expands to.
QWSKeyboardHandler * handler
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
QList< Activity > actList
void dataReady(uint32_t keycode, bool pressed)
QWSIntKbPrivate(QWSKeyboardHandler *, const QString &device)
Type
This enum type defines the valid event types in Qt.
bool setup(QString driverName, uint32_t index)
void start(Priority=InheritPriority)
Begins execution of the thread by calling run().
QWSIntKeyboardHandler(const QString &)
bool wait(unsigned long time=ULONG_MAX)
Blocks the thread until either of these conditions is met:
The QPoint class defines a point in the plane using integer precision.
virtual ~QWSIntKeyboardHandler()
QFuture< T > run(Function function,...)
~QIntKeyboardListenThread()
QList< HIDHandle > handleList
void kbdDataAvailable(uint32_t keycode, bool pressed)
QImageIOHandler * handler
The QThread class provides a platform-independent way to manage threads.
void exit(int retcode=0)
Tells the thread's event loop to exit with a return code.
QIntKeyboardListenThread(QWSIntKbPrivate *im)
QIntKeyboardListenThread * kbdthread