Decouple system keyboard/joystick events from connected actions

The Mac OS/X event loop complained that system event processing took
too much time and disabled event taps. This commit speeds up system
event handling by connecting CInputManager with a queued connection.
This calls all (potentially expensive) hotkey actions asynchronously.
This commit is contained in:
Roland Winklmeier
2016-08-15 23:55:41 +02:00
committed by Mathew Sutcliffe
parent 9515109719
commit 7f9c99ca7a

View File

@@ -28,8 +28,8 @@ namespace BlackCore
m_keyboard(IKeyboard::create(this)),
m_joystick(IJoystick::create(this))
{
connect(m_keyboard.get(), &IKeyboard::keyCombinationChanged, this, &CInputManager::ps_processKeyCombinationChanged);
connect(m_joystick.get(), &IJoystick::buttonCombinationChanged, this, &CInputManager::ps_processButtonCombinationChanged);
connect(m_keyboard.get(), &IKeyboard::keyCombinationChanged, this, &CInputManager::ps_processKeyCombinationChanged, Qt::QueuedConnection);
connect(m_joystick.get(), &IJoystick::buttonCombinationChanged, this, &CInputManager::ps_processButtonCombinationChanged, Qt::QueuedConnection);
}
CInputManager *CInputManager::instance()