From 7f9c99ca7a7530fd25a9755645576b623d3118cb Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Mon, 15 Aug 2016 23:55:41 +0200 Subject: [PATCH] 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. --- src/blackcore/inputmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blackcore/inputmanager.cpp b/src/blackcore/inputmanager.cpp index 2a8278e15..23530b114 100644 --- a/src/blackcore/inputmanager.cpp +++ b/src/blackcore/inputmanager.cpp @@ -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()