refs #313 Fix argument by const reference

This commit is contained in:
Roland Winklmeier
2014-08-05 11:35:48 +02:00
parent 2f527f72c3
commit 8e16f9619f
7 changed files with 7 additions and 5 deletions

View File

@@ -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();

View File

@@ -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);

View File

@@ -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:

View File

@@ -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);

View File

@@ -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:

View File

@@ -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);

View File

@@ -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; }