summaryrefslogtreecommitdiff
path: root/src/input_common/main.cpp
diff options
context:
space:
mode:
authorGravatar FearlessTobi2020-07-14 19:01:36 +0200
committerGravatar FearlessTobi2020-08-29 18:56:34 +0200
commite6bd1fd1b8487e421f71d43b6073ee56de1a043d (patch)
tree53b383906fae814a67ae270b9b510a60f1b5df9d /src/input_common/main.cpp
parentMerge pull request #4604 from lioncash/lifetime (diff)
downloadyuzu-e6bd1fd1b8487e421f71d43b6073ee56de1a043d.tar.gz
yuzu-e6bd1fd1b8487e421f71d43b6073ee56de1a043d.tar.xz
yuzu-e6bd1fd1b8487e421f71d43b6073ee56de1a043d.zip
yuzu: Add motion and touch configuration
Diffstat (limited to 'src/input_common/main.cpp')
-rw-r--r--src/input_common/main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/input_common/main.cpp b/src/input_common/main.cpp
index 57e7a25fe..f9d7b408f 100644
--- a/src/input_common/main.cpp
+++ b/src/input_common/main.cpp
@@ -11,6 +11,7 @@
11#include "input_common/keyboard.h" 11#include "input_common/keyboard.h"
12#include "input_common/main.h" 12#include "input_common/main.h"
13#include "input_common/motion_emu.h" 13#include "input_common/motion_emu.h"
14#include "input_common/touch_from_button.h"
14#include "input_common/udp/udp.h" 15#include "input_common/udp/udp.h"
15#ifdef HAVE_SDL2 16#ifdef HAVE_SDL2
16#include "input_common/sdl/sdl.h" 17#include "input_common/sdl/sdl.h"
@@ -32,6 +33,8 @@ struct InputSubsystem::Impl {
32 std::make_shared<AnalogFromButton>()); 33 std::make_shared<AnalogFromButton>());
33 motion_emu = std::make_shared<MotionEmu>(); 34 motion_emu = std::make_shared<MotionEmu>();
34 Input::RegisterFactory<Input::MotionDevice>("motion_emu", motion_emu); 35 Input::RegisterFactory<Input::MotionDevice>("motion_emu", motion_emu);
36 Input::RegisterFactory<Input::TouchDevice>("touch_from_button",
37 std::make_shared<TouchFromButtonFactory>());
35 38
36#ifdef HAVE_SDL2 39#ifdef HAVE_SDL2
37 sdl = SDL::Init(); 40 sdl = SDL::Init();
@@ -46,6 +49,7 @@ struct InputSubsystem::Impl {
46 Input::UnregisterFactory<Input::AnalogDevice>("analog_from_button"); 49 Input::UnregisterFactory<Input::AnalogDevice>("analog_from_button");
47 Input::UnregisterFactory<Input::MotionDevice>("motion_emu"); 50 Input::UnregisterFactory<Input::MotionDevice>("motion_emu");
48 motion_emu.reset(); 51 motion_emu.reset();
52 Input::UnregisterFactory<Input::TouchDevice>("touch_from_button");
49#ifdef HAVE_SDL2 53#ifdef HAVE_SDL2
50 sdl.reset(); 54 sdl.reset();
51#endif 55#endif
@@ -171,6 +175,11 @@ const GCButtonFactory* InputSubsystem::GetGCButtons() const {
171 return impl->gcbuttons.get(); 175 return impl->gcbuttons.get();
172} 176}
173 177
178void ReloadInputDevices() {
179 if (udp)
180 udp->ReloadUDPClient();
181}
182
174std::vector<std::unique_ptr<Polling::DevicePoller>> InputSubsystem::GetPollers( 183std::vector<std::unique_ptr<Polling::DevicePoller>> InputSubsystem::GetPollers(
175 Polling::DeviceType type) const { 184 Polling::DeviceType type) const {
176#ifdef HAVE_SDL2 185#ifdef HAVE_SDL2