mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
refs #401 Implementation of IJoystick for Linux
Basically, the implementation uses the API described in the kernel documentation. It listens for new events that come from the device. It also supports joystick hotplugging. * https://www.kernel.org/doc/Documentation/input/joystick-api.txt
This commit is contained in:
committed by
Roland Winklmeier
parent
c94e5c0fbd
commit
2b07dfb789
@@ -131,7 +131,7 @@ namespace BlackInput
|
||||
quint8 events[EV_MAX/8 + 1];
|
||||
memset(events, 0, sizeof(events));
|
||||
|
||||
if ((ioctl(fd, EVIOCGVERSION, &version) >= 0) && (ioctl(fd, EVIOCGNAME(sizeof(name)), name)>=0) && (ioctl(fd, EVIOCGBIT(0,sizeof(events)), &events) >= 0) && test_bit(EV_KEY, events) && (((version >> 16) & 0xFF) > 0)) {
|
||||
if ((ioctl(fd, EVIOCGVERSION, &version) >= 0) && (ioctl(fd, EVIOCGNAME(sizeof(name)), name)>=0) && (ioctl(fd, EVIOCGBIT(0,sizeof(events)), &events) >= 0) && test_bit(EV_KEY, events) && !test_bit(EV_SYN, events) && (((version >> 16) & 0xFF) > 0)) {
|
||||
name[255]=0;
|
||||
qDebug() << "CKeyboardLinux: " << qPrintable(inputFile->fileName()) << " " << name;
|
||||
// Is it grabbed by someone else?
|
||||
|
||||
Reference in New Issue
Block a user