summaryrefslogtreecommitdiff
path: root/src/input_common/input_poller.h
diff options
context:
space:
mode:
authorGravatar german772021-10-11 00:43:11 -0500
committerGravatar Narr the Reg2021-11-24 20:30:24 -0600
commit06a5ef5874144a70e30e577a83ba68d1dad79e78 (patch)
tree867fa1153c7285c858cdb5bd7f60f08266532a88 /src/input_common/input_poller.h
parentcore: Update input interpreter (diff)
downloadyuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.gz
yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.xz
yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.zip
core/hid: Add output devices
Diffstat (limited to '')
-rw-r--r--src/input_common/input_poller.h28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/input_common/input_poller.h b/src/input_common/input_poller.h
index 3c1e5b541..16cade5fa 100644
--- a/src/input_common/input_poller.h
+++ b/src/input_common/input_poller.h
@@ -16,12 +16,32 @@ class InputEngine;
16/** 16/**
17 * An Input factory. It receives input events and forward them to all input devices it created. 17 * An Input factory. It receives input events and forward them to all input devices it created.
18 */ 18 */
19
20class OutputFactory final : public Input::Factory<Input::OutputDevice> {
21public:
22 explicit OutputFactory(std::shared_ptr<InputEngine> input_engine_);
23
24 /**
25 * Creates an output device from the parameters given.
26 * @param params contains parameters for creating the device:
27 * @param - "guid": text string for identifing controllers
28 * @param - "port": port of the connected device
29 * @param - "pad": slot of the connected controller
30 * @return an unique ouput device with the parameters specified
31 */
32 std::unique_ptr<Input::OutputDevice> Create(
33 const Common::ParamPackage& params) override;
34
35private:
36 std::shared_ptr<InputEngine> input_engine;
37};
38
19class InputFactory final : public Input::Factory<Input::InputDevice> { 39class InputFactory final : public Input::Factory<Input::InputDevice> {
20public: 40public:
21 explicit InputFactory(std::shared_ptr<InputEngine> input_engine_); 41 explicit InputFactory(std::shared_ptr<InputEngine> input_engine_);
22 42
23 /** 43 /**
24 * Creates a input device from the parameters given. Identifies the type of input to be returned 44 * Creates an input device from the parameters given. Identifies the type of input to be returned
25 * if it contains the following parameters: 45 * if it contains the following parameters:
26 * - button: Contains "button" or "code" 46 * - button: Contains "button" or "code"
27 * - hat_button: Contains "hat" 47 * - hat_button: Contains "hat"
@@ -32,6 +52,7 @@ public:
32 * - motion: Contains "motion" 52 * - motion: Contains "motion"
33 * - touch: Contains "button", "axis_x" and "axis_y" 53 * - touch: Contains "button", "axis_x" and "axis_y"
34 * - battery: Contains "battery" 54 * - battery: Contains "battery"
55 * - output: Contains "output"
35 * @param params contains parameters for creating the device: 56 * @param params contains parameters for creating the device:
36 * @param - "code": the code of the keyboard key to bind with the input 57 * @param - "code": the code of the keyboard key to bind with the input
37 * @param - "button": same as "code" but for controller buttons 58 * @param - "button": same as "code" but for controller buttons
@@ -41,10 +62,11 @@ public:
41 * @param - "axis_x": same as axis but specifing horizontal direction 62 * @param - "axis_x": same as axis but specifing horizontal direction
42 * @param - "axis_y": same as axis but specifing vertical direction 63 * @param - "axis_y": same as axis but specifing vertical direction
43 * @param - "axis_z": same as axis but specifing forward direction 64 * @param - "axis_z": same as axis but specifing forward direction
44 * @param - "battery": Only used as a placeholder to set the input type 65 * @param - "battery": Only used as a placeholder to set the input type
45 * @return an unique input device with the parameters specified 66 * @return an unique input device with the parameters specified
46 */ 67 */
47 std::unique_ptr<Input::InputDevice> Create(const Common::ParamPackage& params) override; 68 std::unique_ptr<Input::InputDevice> Create(
69 const Common::ParamPackage& params) override;
48 70
49private: 71private:
50 /** 72 /**