diff --git a/src/blackmisc/input/joystickbutton.cpp b/src/blackmisc/input/joystickbutton.cpp index 98a3245f9..70447c4b6 100644 --- a/src/blackmisc/input/joystickbutton.cpp +++ b/src/blackmisc/input/joystickbutton.cpp @@ -24,6 +24,12 @@ namespace BlackMisc m_buttonIndex = buttonIndex; } + bool CJoystickButton::isValid() const + { + if (!m_deviceName.isEmpty() && m_buttonIndex >= 0) { return true; } + else { return false; } + } + void CJoystickButton::setButtonObject(CJoystickButton button) { this->m_buttonIndex = button.m_buttonIndex; diff --git a/src/blackmisc/input/joystickbutton.h b/src/blackmisc/input/joystickbutton.h index 8b7de74a7..0030ba338 100644 --- a/src/blackmisc/input/joystickbutton.h +++ b/src/blackmisc/input/joystickbutton.h @@ -61,7 +61,7 @@ namespace BlackMisc void setButtonIndex(int buttonIndex); //! Is valid? - bool isValid() const { return !m_deviceName.isEmpty() && m_buttonIndex >= 0 ? true : false; } + bool isValid() const; //! Set button object void setButtonObject(CJoystickButton button);