mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 19:25:49 +08:00
refs #313 Fix argument by const reference
This commit is contained in:
@@ -57,7 +57,7 @@ namespace BlackInput
|
|||||||
* \param key
|
* \param key
|
||||||
* \param isPressed
|
* \param isPressed
|
||||||
*/
|
*/
|
||||||
virtual void triggerKey(const BlackMisc::Hardware::CKeyboardKey key, bool isPressed) = 0;
|
virtual void triggerKey(const BlackMisc::Hardware::CKeyboardKey &key, bool isPressed) = 0;
|
||||||
|
|
||||||
//! Creates a native keyboard handler object
|
//! Creates a native keyboard handler object
|
||||||
static IKeyboard *getInstance();
|
static IKeyboard *getInstance();
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ namespace BlackInput
|
|||||||
m_pressedKey.setKeyObject(CKeyboardKey());
|
m_pressedKey.setKeyObject(CKeyboardKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CKeyboardLinux::triggerKey(const CKeyboardKey &key, bool isPressed)
|
||||||
{
|
{
|
||||||
if(!isPressed) emit keyUp(key);
|
if(!isPressed) emit keyUp(key);
|
||||||
else emit keyDown(key);
|
else emit keyDown(key);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace BlackInput
|
|||||||
virtual void startCapture(bool ignoreNextKey = false) override;
|
virtual void startCapture(bool ignoreNextKey = false) override;
|
||||||
|
|
||||||
//! \copydoc IKeyboard::triggerKey()
|
//! \copydoc IKeyboard::triggerKey()
|
||||||
virtual void triggerKey(const BlackMisc::Hardware::CKeyboardKey key, bool isPressed) override;
|
virtual void triggerKey(const BlackMisc::Hardware::CKeyboardKey &key, bool isPressed) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ namespace BlackInput
|
|||||||
m_pressedKey.setKeyObject(CKeyboardKey());
|
m_pressedKey.setKeyObject(CKeyboardKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CKeyboardMac::triggerKey(const CKeyboardKey &key, bool isPressed)
|
||||||
{
|
{
|
||||||
if(!isPressed) emit keyUp(key);
|
if(!isPressed) emit keyUp(key);
|
||||||
else emit keyDown(key);
|
else emit keyDown(key);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace BlackInput
|
|||||||
virtual void startCapture(bool ignoreNextKey = false) override;
|
virtual void startCapture(bool ignoreNextKey = false) override;
|
||||||
|
|
||||||
//! \copydoc IKeyboard::triggerKey()
|
//! \copydoc IKeyboard::triggerKey()
|
||||||
virtual void triggerKey(const BlackMisc::Hardware::CKeyboardKey key, bool isPressed) override;
|
virtual void triggerKey(const BlackMisc::Hardware::CKeyboardKey &key, bool isPressed) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ namespace BlackInput
|
|||||||
m_pressedKey.setKeyObject(CKeyboardKey());
|
m_pressedKey.setKeyObject(CKeyboardKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CKeyboardWindows::triggerKey(const CKeyboardKey key, bool isPressed)
|
void CKeyboardWindows::triggerKey(const CKeyboardKey &key, bool isPressed)
|
||||||
{
|
{
|
||||||
if(!isPressed) emit keyUp(key);
|
if(!isPressed) emit keyUp(key);
|
||||||
else emit keyDown(key);
|
else emit keyDown(key);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace BlackInput
|
|||||||
virtual void startCapture(bool ignoreNextKey = false) override;
|
virtual void startCapture(bool ignoreNextKey = false) override;
|
||||||
|
|
||||||
//! \copydoc IKeyboard::triggerKey()
|
//! \copydoc IKeyboard::triggerKey()
|
||||||
virtual void triggerKey(const BlackMisc::Hardware::CKeyboardKey key, bool isPressed) override;
|
virtual void triggerKey(const BlackMisc::Hardware::CKeyboardKey &key, bool isPressed) override;
|
||||||
|
|
||||||
//! \brief Keyboard hook handle
|
//! \brief Keyboard hook handle
|
||||||
HHOOK keyboardHook() const { return m_keyboardHook; }
|
HHOOK keyboardHook() const { return m_keyboardHook; }
|
||||||
|
|||||||
Reference in New Issue
Block a user