Convert KeyboardInput to non-virtual class
This commit is contained in:
@@ -15,11 +15,6 @@ namespace advsettings
|
||||
{
|
||||
void UtilitiesTabController::initStage1()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
keyboardInput.reset( new KeyboardInputWindows() );
|
||||
#else
|
||||
keyboardInput.reset( new KeyboardInputDummy() );
|
||||
#endif
|
||||
auto settings = OverlayController::appSettings();
|
||||
settings->beginGroup( "utilitiesSettings" );
|
||||
auto qAlarmEnabled = settings->value( "alarmEnabled", m_alarmEnabled );
|
||||
@@ -41,44 +36,44 @@ void UtilitiesTabController::initStage2( OverlayController* var_parent,
|
||||
|
||||
void UtilitiesTabController::sendKeyboardInput( QString input )
|
||||
{
|
||||
keyboardInput->sendKeyboardInput( input );
|
||||
keyboardInput.sendKeyboardInput( input );
|
||||
}
|
||||
|
||||
void UtilitiesTabController::sendKeyboardEnter()
|
||||
{
|
||||
keyboardInput->sendKeyboardEnter();
|
||||
keyboardInput.sendKeyboardEnter();
|
||||
}
|
||||
|
||||
void UtilitiesTabController::sendKeyboardAltEnter()
|
||||
{
|
||||
keyboardInput->sendKeyboardAltEnter();
|
||||
keyboardInput.sendKeyboardAltEnter();
|
||||
}
|
||||
|
||||
void UtilitiesTabController::sendKeyboardAltTab()
|
||||
{
|
||||
keyboardInput->sendKeyboardAltTab();
|
||||
keyboardInput.sendKeyboardAltTab();
|
||||
}
|
||||
|
||||
void UtilitiesTabController::sendKeyboardBackspace( const int count )
|
||||
{
|
||||
keyboardInput->sendKeyboardBackspace( count );
|
||||
keyboardInput.sendKeyboardBackspace( count );
|
||||
}
|
||||
|
||||
void UtilitiesTabController::sendMediaNextSong()
|
||||
{
|
||||
keyboardInput->sendMediaNextSong();
|
||||
keyboardInput.sendMediaNextSong();
|
||||
}
|
||||
void UtilitiesTabController::sendMediaPreviousSong()
|
||||
{
|
||||
keyboardInput->sendMediaPreviousSong();
|
||||
keyboardInput.sendMediaPreviousSong();
|
||||
}
|
||||
void UtilitiesTabController::sendMediaPausePlay()
|
||||
{
|
||||
keyboardInput->sendMediaPausePlay();
|
||||
keyboardInput.sendMediaPausePlay();
|
||||
}
|
||||
void UtilitiesTabController::sendMediaStopSong()
|
||||
{
|
||||
keyboardInput->sendMediaStopSong();
|
||||
keyboardInput.sendMediaStopSong();
|
||||
}
|
||||
|
||||
bool UtilitiesTabController::alarmEnabled() const
|
||||
|
||||
@@ -5,7 +5,11 @@
|
||||
#include <QTime>
|
||||
#include <openvr.h>
|
||||
#include <memory>
|
||||
#include "KeyboardInput.h"
|
||||
#ifdef WIN32
|
||||
# include "keyboardinput/KeyboardInputWindows.h"
|
||||
#else
|
||||
# include "keyboardinput/KeyboardInputDummy.h"
|
||||
#endif
|
||||
|
||||
class QQuickWindow;
|
||||
// application namespace
|
||||
@@ -42,7 +46,11 @@ private:
|
||||
int m_batteryState[vr::k_unMaxTrackedDeviceCount];
|
||||
bool m_batteryVisible[vr::k_unMaxTrackedDeviceCount];
|
||||
|
||||
std::unique_ptr<KeyboardInput> keyboardInput;
|
||||
#ifdef WIN32
|
||||
KeyboardInputWindows keyboardInput;
|
||||
#else
|
||||
KeyboardInputDummy keyboardInput;
|
||||
#endif
|
||||
|
||||
public:
|
||||
void initStage1();
|
||||
|
||||
@@ -6,18 +6,18 @@
|
||||
// application namespace
|
||||
namespace advsettings
|
||||
{
|
||||
class KeyboardInputDummy : public KeyboardInput
|
||||
class KeyboardInputDummy
|
||||
{
|
||||
public:
|
||||
virtual void sendKeyboardInput( QString input ) override;
|
||||
virtual void sendKeyboardEnter() override;
|
||||
virtual void sendKeyboardBackspace( const int count ) override;
|
||||
virtual void sendKeyboardAltTab() override;
|
||||
virtual void sendKeyboardAltEnter() override;
|
||||
virtual void sendMediaNextSong() override;
|
||||
virtual void sendMediaPreviousSong() override;
|
||||
virtual void sendMediaPausePlay() override;
|
||||
virtual void sendMediaStopSong() override;
|
||||
void sendKeyboardInput( QString input );
|
||||
void sendKeyboardEnter();
|
||||
void sendKeyboardBackspace( const int count );
|
||||
void sendKeyboardAltTab();
|
||||
void sendKeyboardAltEnter();
|
||||
void sendMediaNextSong();
|
||||
void sendMediaPreviousSong();
|
||||
void sendMediaPausePlay();
|
||||
void sendMediaStopSong();
|
||||
};
|
||||
|
||||
} // namespace advsettings
|
||||
|
||||
@@ -6,18 +6,18 @@
|
||||
// application namespace
|
||||
namespace advsettings
|
||||
{
|
||||
class KeyboardInputWindows : public KeyboardInput
|
||||
class KeyboardInputWindows
|
||||
{
|
||||
public:
|
||||
virtual void sendKeyboardInput( QString input ) override;
|
||||
virtual void sendKeyboardEnter() override;
|
||||
virtual void sendKeyboardBackspace( const int count ) override;
|
||||
virtual void sendKeyboardAltTab() override;
|
||||
virtual void sendKeyboardAltEnter() override;
|
||||
virtual void sendMediaNextSong() override;
|
||||
virtual void sendMediaPreviousSong() override;
|
||||
virtual void sendMediaPausePlay() override;
|
||||
virtual void sendMediaStopSong() override;
|
||||
void sendKeyboardInput( QString input );
|
||||
void sendKeyboardEnter();
|
||||
void sendKeyboardBackspace( const int count );
|
||||
void sendKeyboardAltTab();
|
||||
void sendKeyboardAltEnter();
|
||||
void sendMediaNextSong();
|
||||
void sendMediaPreviousSong();
|
||||
void sendMediaPausePlay();
|
||||
void sendMediaStopSong();
|
||||
};
|
||||
|
||||
} // namespace advsettings
|
||||
|
||||
Reference in New Issue
Block a user