Remember and ignore hotkey combination before capturing

When capturing a new hotkey combination, we want to get only the delta of the keys and buttons being pressed during the capturing. 

ref T585
This commit is contained in:
Roland Rossgotterer
2019-04-11 10:08:58 +02:00
committed by Mat Sutcliffe
parent c51a1b8c7b
commit 563a69e3f5
5 changed files with 62 additions and 9 deletions

View File

@@ -55,10 +55,16 @@ namespace BlackMisc
CJoystickButtonList getJoystickButtons() const { return m_joystickButtons; }
//! Add keyboard key
void addKeyboardKey(CKeyboardKey key);
void addKeyboardKey(const CKeyboardKey &key);
//! Add joystick button
void addJoystickButton(CJoystickButton button);
void addJoystickButton(const CJoystickButton &button);
//! Does combination contain key?
bool containsKeyboardKey(const CKeyboardKey &key) const;
//! Does combination contain button?
bool containsJoystickButton(const CJoystickButton &button) const;
//! Replace oldKey with newKey
void replaceKey(CKeyboardKey oldKey, CKeyboardKey newKey);
@@ -82,6 +88,9 @@ namespace BlackMisc
//! E.g. CTRL would be a subset of CTRL+D
bool isSubsetOf(const CHotkeyCombination &other) const;
//! Returns the delta (removing all keys and buttons contained in other)
CHotkeyCombination getDeltaComparedTo(const CHotkeyCombination &other) const;
//! \copydoc BlackMisc::Mixin::String::toQString
QString convertToQString(bool i18n = false) const;