Separate media keys from keyboard shortcuts
The media keys were only in the keyboard shortcuts file because their implementation was the same. With Linux support incoming their implementations are not necessarily the same.
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
#include <QTime>
|
||||
#include <openvr.h>
|
||||
#include <memory>
|
||||
#include "keyboardinput/KeyboardInput.h"
|
||||
#include "src/keyboard_input/keyboard_input.h"
|
||||
#include "src/media_keys/media_keys.h"
|
||||
|
||||
class QQuickWindow;
|
||||
// application namespace
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
#include "KeyboardInput.h"
|
||||
#include "src/keyboard_input/input_sender.h"
|
||||
|
||||
namespace keyboardinput
|
||||
{
|
||||
void sendKeyboardInput( QString input )
|
||||
{
|
||||
sendStringAsInput( input.toStdString() );
|
||||
}
|
||||
|
||||
void sendKeyboardEnter()
|
||||
{
|
||||
const auto tokens = std::vector<Token>{ Token::KEY_ENTER };
|
||||
|
||||
sendTokensAsInput( tokens );
|
||||
}
|
||||
|
||||
void sendKeyboardBackspace( const int count )
|
||||
{
|
||||
const auto tokens = std::vector<Token>{ Token::KEY_BACKSPACE };
|
||||
for ( int i = 0; i < count; ++i )
|
||||
{
|
||||
sendTokensAsInput( tokens );
|
||||
}
|
||||
}
|
||||
|
||||
void sendKeyboardAltTab()
|
||||
{
|
||||
const auto tokens
|
||||
= std::vector<Token>{ Token::MODIFIER_ALT, Token::KEY_TAB };
|
||||
|
||||
sendTokensAsInput( tokens );
|
||||
}
|
||||
|
||||
void sendKeyboardAltEnter()
|
||||
{
|
||||
const auto tokens
|
||||
= std::vector<Token>{ Token::MODIFIER_ALT, Token::KEY_ENTER };
|
||||
|
||||
sendTokensAsInput( tokens );
|
||||
}
|
||||
|
||||
void sendKeyboardCtrlC()
|
||||
{
|
||||
const auto tokens
|
||||
= std::vector<Token>{ Token::MODIFIER_CTRL, Token::KEY_c };
|
||||
|
||||
sendTokensAsInput( tokens );
|
||||
}
|
||||
|
||||
void sendKeyboardCtrlV()
|
||||
{
|
||||
const auto tokens
|
||||
= std::vector<Token>{ Token::MODIFIER_CTRL, Token::KEY_v };
|
||||
|
||||
sendTokensAsInput( tokens );
|
||||
}
|
||||
|
||||
void sendMediaNextSong()
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
void sendMediaPreviousSong()
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
void sendMediaPausePlay()
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
void sendMediaStopSong()
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
} // namespace keyboardinput
|
||||
@@ -1,31 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <QString>
|
||||
|
||||
namespace keyboardinput
|
||||
{
|
||||
/*!
|
||||
Represents the state of a keyboard button press. Can be either Up or Down.
|
||||
|
||||
Implemented because neither Qt nor Windows.h included a sensible key state enum.
|
||||
*/
|
||||
enum class KeyStatus
|
||||
{
|
||||
Up,
|
||||
Down,
|
||||
};
|
||||
|
||||
void sendKeyboardInput( QString input );
|
||||
void sendKeyboardEnter();
|
||||
void sendKeyboardBackspace( const int count );
|
||||
void sendKeyboardAltTab();
|
||||
void sendKeyboardAltEnter();
|
||||
void sendKeyboardCtrlC();
|
||||
void sendKeyboardCtrlV();
|
||||
void sendMediaNextSong();
|
||||
void sendMediaPreviousSong();
|
||||
void sendMediaPausePlay();
|
||||
void sendMediaStopSong();
|
||||
|
||||
} // namespace keyboardinput
|
||||
Reference in New Issue
Block a user