implement joystick item switching
This commit is contained in:
parent
00bfa72455
commit
7a61dc9368
8 changed files with 61 additions and 41 deletions
|
|
@ -38,16 +38,6 @@ void ItemScrollBox::addItem(std::weak_ptr<Item> item)
|
|||
widgets_.back()->setShortcuts(QKeySequence(Qt::Key_R), QKeySequence(Qt::Key_F), QKeySequence(Qt::Key_V));
|
||||
else if(train->getTrainId() == 4)
|
||||
widgets_.back()->setShortcuts(QKeySequence(Qt::Key_T), QKeySequence(Qt::Key_G), QKeySequence(Qt::Key_B));
|
||||
|
||||
std::vector<std::shared_ptr<TrainJs>> joysticks = TrainJs::getJsDevices();
|
||||
for(auto joystick: joysticks)
|
||||
{
|
||||
if(!joystick->itemIsSet())
|
||||
{
|
||||
joystick->setItem(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(turnout)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue