diff options
Diffstat (limited to 'src/platformsupport')
-rw-r--r-- | src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp index 3555763b89..de37f5e2df 100644 --- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp +++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp @@ -58,6 +58,14 @@ #include <linux/input.h> #endif +#ifndef input_event_sec +#define input_event_sec time.tv_sec +#endif + +#ifndef input_event_usec +#define input_event_usec time.tv_usec +#endif + QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(qLcEvdevKey, "qt.qpa.input") @@ -149,8 +157,11 @@ void QEvdevKeyboardHandler::switchLed(int led, bool state) { qCDebug(qLcEvdevKey, "switchLed %d %d", led, int(state)); + struct timeval tv; + ::gettimeofday(&tv, 0); struct ::input_event led_ie; - ::gettimeofday(&led_ie.time, 0); + led_ie.input_event_sec = tv.tv_sec; + led_ie.input_event_usec = tv.tv_usec; led_ie.type = EV_LED; led_ie.code = led; led_ie.value = state; |