diff options
Diffstat (limited to 'src/input_common/main.cpp')
| -rw-r--r-- | src/input_common/main.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/input_common/main.cpp b/src/input_common/main.cpp index 57e7a25fe..ea1a1cee6 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,13 @@ const GCButtonFactory* InputSubsystem::GetGCButtons() const { | |||
| 171 | return impl->gcbuttons.get(); | 175 | return impl->gcbuttons.get(); |
| 172 | } | 176 | } |
| 173 | 177 | ||
| 178 | void InputSubsystem::ReloadInputDevices() { | ||
| 179 | if (!impl->udp) { | ||
| 180 | return; | ||
| 181 | } | ||
| 182 | impl->udp->ReloadUDPClient(); | ||
| 183 | } | ||
| 184 | |||
| 174 | std::vector<std::unique_ptr<Polling::DevicePoller>> InputSubsystem::GetPollers( | 185 | std::vector<std::unique_ptr<Polling::DevicePoller>> InputSubsystem::GetPollers( |
| 175 | Polling::DeviceType type) const { | 186 | Polling::DeviceType type) const { |
| 176 | #ifdef HAVE_SDL2 | 187 | #ifdef HAVE_SDL2 |