diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index 4a5bc443ec9..db627d7453a 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -363,15 +363,25 @@ qt_config_compile_test(evdev CODE "#if defined(__FreeBSD__) # include +#elif defined(__VXWORKS__) +#include +typedef EV_DEV_EVENT input_event; #else # include # include #endif enum { +#if defined(__VXWORKS__) + e1 = EV_DEV_ABS, + e2 = EV_DEV_PTR_ABS_X, + e3 = EV_DEV_PTR_ABS_Y, + e4 = EV_DEV_PTR_BTN_TOUCH, +#else e1 = ABS_PRESSURE, e2 = ABS_X, e3 = REL_X, e4 = SYN_REPORT, +#endif }; int main(void) diff --git a/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp b/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp index 03a77aaae7b..963696444b6 100644 --- a/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp +++ b/src/platformsupport/devicediscovery/qdevicediscovery_static.cpp @@ -13,6 +13,9 @@ #ifdef Q_OS_FREEBSD #include +#elif defined(Q_OS_VXWORKS) +#include +#define ABS_X EV_DEV_PTR_ABS_X #else #include #endif @@ -40,10 +43,12 @@ #define LONG_BITS (sizeof(long) * 8 ) #define LONG_FIELD_SIZE(bits) ((bits / LONG_BITS) + 1) +#if !defined(Q_OS_VXWORKS) static bool testBit(long bit, const long *field) { return (field[bit / LONG_BITS] >> bit % LONG_BITS) & 1; } +#endif QT_BEGIN_NAMESPACE @@ -65,6 +70,37 @@ QDeviceDiscoveryStatic::QDeviceDiscoveryStatic(QDeviceTypes types, QObject *pare QStringList QDeviceDiscoveryStatic::scanConnectedDevices() { QStringList devices; + +#if defined(Q_OS_VXWORKS) + + QStringList inputDevices; + UINT32 devCount = 0; + static const char* device = "/input/event"; + int fd = QT_OPEN(device, O_RDONLY | O_NDELAY, 0); + if (fd >= 0) { + if (ERROR == ioctl(fd, EV_DEV_IO_GET_DEV_COUNT, (char *)&devCount)) { + qWarning() << "DeviceDiscovery cannot open device" << device; + return devices; + } + for (UINT32 i=0; i