mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Keyboard and input manager cleanup/style
This commit is contained in:
@@ -69,7 +69,7 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
void CInputManager::ps_changeHotkeySettings()
|
||||
void CInputManager::onChangedHotkeySettings()
|
||||
{
|
||||
m_configuredActions.clear();
|
||||
for (const CActionHotkey &actionHotkey : m_actionHotkeys.getThreadLocal())
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -35,5 +35,4 @@ namespace BlackInput
|
||||
ptr->init();
|
||||
return ptr;
|
||||
}
|
||||
|
||||
} // ns
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user