mirror of
https://github.com/AntiMicroX/antimicrox.git
synced 2026-08-01 18:16:26 -04:00
Change to reset mouse timer connections on device removal. Don't erase old recent profile list on program exit.
This commit is contained in:
@@ -372,6 +372,34 @@ void InputDaemon::quit()
|
||||
eventWorker = 0;
|
||||
}
|
||||
|
||||
void InputDaemon::resetMouseTimers()
|
||||
{
|
||||
if (joysticks->size() > 0)
|
||||
{
|
||||
#ifdef USE_SDL_2
|
||||
QHashIterator<SDL_JoystickID, InputDevice*> iter(*joysticks);
|
||||
#else
|
||||
QHashIterator<int, InputDevice*> iter(*joysticks);
|
||||
#endif
|
||||
while (iter.hasNext())
|
||||
{
|
||||
InputDevice *joystick = iter.next().value();
|
||||
if (joystick && joystick->getNumberButtons() > 0)
|
||||
{
|
||||
// Find first button of first joystick and use it for the
|
||||
// psuedo-static QTimer calls.
|
||||
SetJoystick *set = joystick->getActiveSetJoystick();
|
||||
JoyButton *button = set->getJoyButton(0);
|
||||
if (button)
|
||||
{
|
||||
set->getJoyButton(0)->establishMouseTimerConnections();
|
||||
iter.toBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_SDL_2
|
||||
void InputDaemon::refreshMapping(QString mapping, InputDevice *device)
|
||||
{
|
||||
@@ -428,6 +456,7 @@ void InputDaemon::removeDevice(InputDevice *device)
|
||||
trackjoysticks.remove(deviceID);
|
||||
trackcontrollers.remove(deviceID);
|
||||
|
||||
resetMouseTimers();
|
||||
refreshIndexes();
|
||||
|
||||
emit deviceRemoved(deviceID);
|
||||
|
||||
Reference in New Issue
Block a user