citra-qt: Add base support for hotkey reconfiguration + UI (whole of PR citra-emu/citra#3786)
* Adds a new Hotkeys tab in the Controls group. * Right click to reconfigure. * See the original PR for more details & screenshots.
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <QKeyEvent>
|
||||
#include <QKeySequence>
|
||||
#include <QWidget>
|
||||
#include "common/param_package.h"
|
||||
#include "core/settings.h"
|
||||
@@ -38,6 +39,13 @@ public:
|
||||
|
||||
/// Load configuration settings.
|
||||
void loadConfiguration();
|
||||
void EmitInputKeysChanged();
|
||||
|
||||
public slots:
|
||||
void OnHotkeysChanged(QList<QKeySequence> new_key_list);
|
||||
|
||||
signals:
|
||||
void InputKeysChanged(QList<QKeySequence> new_key_list);
|
||||
|
||||
// Save the current input profile index
|
||||
void ApplyProfile();
|
||||
@@ -72,10 +80,16 @@ private:
|
||||
|
||||
std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> device_pollers;
|
||||
|
||||
/// Keys currently registered as hotkeys
|
||||
QList<QKeySequence> hotkey_list;
|
||||
|
||||
/// A flag to indicate if keyboard keys are okay when configuring an input. If this is false,
|
||||
/// keyboard events are ignored.
|
||||
bool want_keyboard_keys = false;
|
||||
|
||||
/// Generates list of all used keys
|
||||
QList<QKeySequence> GetUsedKeyboardKeys();
|
||||
|
||||
/// Restore all buttons to their default values.
|
||||
void restoreDefaults();
|
||||
/// Clear all input configuration
|
||||
@@ -89,6 +103,9 @@ private:
|
||||
std::function<void(const Common::ParamPackage&)> new_input_setter,
|
||||
InputCommon::Polling::DeviceType type);
|
||||
|
||||
/// The key code of the previous state of the key being currently bound.
|
||||
int previous_key_code;
|
||||
|
||||
/// Finish polling and configure input using the input_setter
|
||||
void setPollingResult(const Common::ParamPackage& params, bool abort);
|
||||
|
||||
|
Reference in New Issue
Block a user