From eaff98dbb3da3c7524a504abb1cdd5daa3480dda Mon Sep 17 00:00:00 2001 From: muemart Date: Wed, 6 Dec 2017 05:26:29 +0100 Subject: Adding meumart's Citra SDL Joystick support. Citra PR #3116 --- src/yuzu/configuration/configure_input.h | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'src/yuzu/configuration/configure_input.h') diff --git a/src/yuzu/configuration/configure_input.h b/src/yuzu/configuration/configure_input.h index c950fbcb4..a0bef86d5 100644 --- a/src/yuzu/configuration/configure_input.h +++ b/src/yuzu/configuration/configure_input.h @@ -8,11 +8,13 @@ #include #include #include +#include #include #include #include #include "common/param_package.h" #include "core/settings.h" +#include "input_common/main.h" #include "ui_configure_input.h" class QPushButton; @@ -35,10 +37,11 @@ public: private: std::unique_ptr ui; - std::unique_ptr timer; + std::unique_ptr timeout_timer; + std::unique_ptr poll_timer; /// This will be the the setting function when an input is awaiting configuration. - boost::optional> key_setter; + boost::optional> input_setter; std::array buttons_param; std::array analogs_param; @@ -48,13 +51,23 @@ private: /// Each button input is represented by a QPushButton. std::array button_map; - /// Each analog input is represented by five QPushButtons which represents up, down, left, right - /// and modifier + /// A group of five QPushButtons represent one analog input. The buttons each represent up, + /// down, left, right, and modifier, respectively. std::array, Settings::NativeAnalog::NumAnalogs> - analog_map; + analog_map_buttons; + + /// Analog inputs are also represented each with a single button, used to configure with an + /// actual analog stick + std::array analog_map_stick; static const std::array analog_sub_buttons; + std::vector> device_pollers; + + /// 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; + /// Load configuration settings. void loadConfiguration(); /// Restore all buttons to their default values. @@ -63,7 +76,13 @@ private: void updateButtonLabels(); /// Called when the button was pressed. - void handleClick(QPushButton* button, std::function new_key_setter); + void handleClick(QPushButton* button, + std::function new_input_setter, + InputCommon::Polling::DeviceType type); + + /// Finish polling and configure input using the input_setter + void setPollingResult(const Common::ParamPackage& params, bool abort); + /// Handle key press events. void keyPressEvent(QKeyEvent* event) override; }; -- cgit v1.2.3