| | |
| | |
| | |
| |
|
| | #pragma once |
| |
|
| | #include <array> |
| | #include <functional> |
| | #include <memory> |
| | #include <optional> |
| | #include <string> |
| | #include <QKeySequence> |
| | #include <QWidget> |
| | #include "common/param_package.h" |
| | #include "common/settings.h" |
| | #include "input_common/main.h" |
| |
|
| | class QKeyEvent; |
| | class QLabel; |
| | class QPushButton; |
| | class QSlider; |
| | class QString; |
| | class QTimer; |
| |
|
| | namespace Ui { |
| | class ConfigureInput; |
| | } |
| |
|
| | class ConfigureInput : public QWidget { |
| | Q_OBJECT |
| |
|
| | public: |
| | explicit ConfigureInput(QWidget* parent = nullptr); |
| | ~ConfigureInput() override; |
| |
|
| | |
| | void ApplyConfiguration(); |
| | void RetranslateUI(); |
| |
|
| | |
| | void LoadConfiguration(); |
| | void EmitInputKeysChanged(); |
| |
|
| | |
| | void ApplyProfile(); |
| | public slots: |
| | void OnHotkeysChanged(QList<QKeySequence> new_key_list); |
| |
|
| | signals: |
| | void InputKeysChanged(QList<QKeySequence> new_key_list); |
| |
|
| | private: |
| | std::unique_ptr<Ui::ConfigureInput> ui; |
| |
|
| | std::unique_ptr<QTimer> timeout_timer; |
| | std::unique_ptr<QTimer> poll_timer; |
| |
|
| | |
| | std::optional<std::function<void(const Common::ParamPackage&)>> input_setter; |
| |
|
| | std::array<Common::ParamPackage, Settings::NativeButton::NumButtons> buttons_param; |
| | std::array<Common::ParamPackage, Settings::NativeAnalog::NumAnalogs> analogs_param; |
| |
|
| | static constexpr int ANALOG_SUB_BUTTONS_NUM = 5; |
| |
|
| | |
| | std::array<QPushButton*, Settings::NativeButton::NumButtons> button_map; |
| |
|
| | |
| | |
| | std::array<std::array<QPushButton*, ANALOG_SUB_BUTTONS_NUM>, Settings::NativeAnalog::NumAnalogs> |
| | analog_map_buttons; |
| |
|
| | |
| | |
| | std::array<QPushButton*, Settings::NativeAnalog::NumAnalogs> analog_map_stick; |
| | std::array<QSlider*, Settings::NativeAnalog::NumAnalogs> |
| | analog_map_deadzone_and_modifier_slider; |
| | std::array<QLabel*, Settings::NativeAnalog::NumAnalogs> |
| | analog_map_deadzone_and_modifier_slider_label; |
| |
|
| | static const std::array<std::string, ANALOG_SUB_BUTTONS_NUM> analog_sub_buttons; |
| |
|
| | std::vector<std::unique_ptr<InputCommon::Polling::DevicePoller>> device_pollers; |
| |
|
| | |
| | |
| | |
| | |
| | |
| | QList<QKeySequence> hotkey_list; |
| |
|
| | |
| | |
| | bool want_keyboard_keys = false; |
| |
|
| | |
| | QList<QKeySequence> GetUsedKeyboardKeys(); |
| |
|
| | void MapFromButton(const Common::ParamPackage& params); |
| | void AutoMap(); |
| |
|
| | |
| | void RestoreDefaults(); |
| | |
| | void ClearAll(); |
| |
|
| | |
| | void UpdateButtonLabels(); |
| |
|
| | |
| | void HandleClick(QPushButton* button, |
| | std::function<void(const Common::ParamPackage&)> new_input_setter, |
| | InputCommon::Polling::DeviceType type); |
| |
|
| | |
| | int previous_key_code; |
| |
|
| | |
| | void SetPollingResult(const Common::ParamPackage& params, bool abort); |
| |
|
| | |
| | void keyPressEvent(QKeyEvent* event) override; |
| |
|
| | |
| | void NewProfile(); |
| | void DeleteProfile(); |
| | void RenameProfile(); |
| |
|
| | bool IsProfileNameDuplicate(const QString& name) const; |
| | void WarnProposedProfileNameIsDuplicate(); |
| | }; |
| |
|