Keyboard and input manager cleanup/style

This commit is contained in:
Klaus Basan
2018-08-21 23:11:40 +02:00
parent 433818ca4f
commit 48738c87ab
4 changed files with 12 additions and 14 deletions

View File

@@ -69,7 +69,7 @@ namespace BlackCore
}
}
void CInputManager::ps_changeHotkeySettings()
void CInputManager::onChangedHotkeySettings()
{
m_configuredActions.clear();
for (const CActionHotkey &actionHotkey : m_actionHotkeys.getThreadLocal())

View File

@@ -111,9 +111,6 @@ namespace BlackCore
void ps_processKeyCombinationChanged(const BlackMisc::Input::CHotkeyCombination &combination);
void ps_processButtonCombinationChanged(const BlackMisc::Input::CHotkeyCombination &combination);
//! Change hotkey settings
void ps_changeHotkeySettings();
private:
//! Handle to a bound action
struct BindInfo
@@ -125,13 +122,17 @@ namespace BlackCore
std::function<void(bool)> m_function;
};
//! Change hotkey settings
void onChangedHotkeySettings();
//! Bind action
int bindImpl(const QString &action, QObject *receiver, std::function<void(bool)> function);
//! Process the hotkey combination
void processCombination(const BlackMisc::Input::CHotkeyCombination &combination);
static CInputManager *m_instance;
std::unique_ptr<BlackInput::IKeyboard> m_keyboard;
std::unique_ptr<BlackInput::IJoystick> m_joystick;
std::unique_ptr<BlackInput::IKeyboard> m_keyboard; //!< keyboard
std::unique_ptr<BlackInput::IJoystick> m_joystick; //!< joystick
QMap<QString, QPixmap> m_availableActions;
QHash<BlackMisc::Input::CHotkeyCombination, QString> m_configuredActions;
@@ -142,8 +143,8 @@ namespace BlackCore
BlackMisc::Input::CHotkeyCombination m_lastCombination;
BlackMisc::Input::CHotkeyCombination m_capturedCombination;
BlackMisc::CSetting<BlackCore::Application::TActionHotkeys> m_actionHotkeys { this, &CInputManager::ps_changeHotkeySettings };
BlackMisc::CSetting<Application::TActionHotkeys> m_actionHotkeys { this, &CInputManager::onChangedHotkeySettings };
};
}
} // ns
#endif //guard

View File

@@ -35,5 +35,4 @@ namespace BlackInput
ptr->init();
return ptr;
}
} // ns

View File

@@ -26,6 +26,7 @@ namespace BlackInput
class BLACKINPUT_EXPORT IKeyboard : public QObject
{
Q_OBJECT
public:
//! Constructor
IKeyboard(QObject *parent = nullptr);
@@ -43,9 +44,6 @@ namespace BlackInput
protected:
//! Initializes the platform keyboard device
virtual bool init() = 0;
private:
static IKeyboard *m_instance;
};
} // ns