kopia lustrzana https://gitlab.com/eliggett/wfview
Add some button mapping
rodzic
6255542ee1
commit
6a0997017e
|
@ -399,4 +399,23 @@ void usbController::ledControl(bool on, unsigned char num)
|
|||
|
||||
qDebug(logUsbControl()) << "write() success";
|
||||
}
|
||||
}
|
||||
|
||||
void usbController::buttonState(char num, bool val)
|
||||
{
|
||||
for (BUTTON* but = buttonList->begin(); but != buttonList->end(); but++) {
|
||||
if (but->dev == usbDevice && but->num == num) {
|
||||
|
||||
if (val && but->onCommand->index > 0) {
|
||||
qInfo(logUsbControl()) << "On Button event:" << but->onCommand->text;
|
||||
emit button(but->onCommand);
|
||||
}
|
||||
if (!val && but->offCommand->index > 0) {
|
||||
qInfo(logUsbControl()) << "Off Button event:" << but->offCommand->text;
|
||||
emit button(but->offCommand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -116,6 +116,7 @@ private:
|
|||
QString manufacturer="";
|
||||
QString serial="<none>";
|
||||
QGamepad* gamepad=Q_NULLPTR;
|
||||
void buttonState(char but, bool val);
|
||||
|
||||
protected:
|
||||
};
|
||||
|
|
Ładowanie…
Reference in New Issue