diff options
| author | 2022-01-16 18:03:11 -0600 | |
|---|---|---|
| committer | 2022-01-16 20:37:34 -0600 | |
| commit | 9eab07f86370eb97eb6e87624163ae07fb055ac9 (patch) | |
| tree | 1a6a123331324404cd64dd6622ac191a76e6bd4e /src/input_common/input_mapping.cpp | |
| parent | Merge pull request #7713 from gidoly/patch-3 (diff) | |
| download | yuzu-9eab07f86370eb97eb6e87624163ae07fb055ac9.tar.gz yuzu-9eab07f86370eb97eb6e87624163ae07fb055ac9.tar.xz yuzu-9eab07f86370eb97eb6e87624163ae07fb055ac9.zip | |
input_common: Reintroduce motion from mouse and use button names
Diffstat (limited to '')
| -rw-r--r-- | src/input_common/input_mapping.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/input_common/input_mapping.cpp b/src/input_common/input_mapping.cpp index 6e0024b2d..475257f42 100644 --- a/src/input_common/input_mapping.cpp +++ b/src/input_common/input_mapping.cpp | |||
| @@ -143,6 +143,19 @@ void MappingFactory::RegisterMotion(const MappingData& data) { | |||
| 143 | } | 143 | } |
| 144 | new_input.Set("port", static_cast<int>(data.pad.port)); | 144 | new_input.Set("port", static_cast<int>(data.pad.port)); |
| 145 | new_input.Set("pad", static_cast<int>(data.pad.pad)); | 145 | new_input.Set("pad", static_cast<int>(data.pad.pad)); |
| 146 | |||
| 147 | // If engine is mouse map the mouse position as 3 axis motion | ||
| 148 | if (data.engine == "mouse") { | ||
| 149 | new_input.Set("axis_x", 1); | ||
| 150 | new_input.Set("invert_x", "-"); | ||
| 151 | new_input.Set("axis_y", 0); | ||
| 152 | new_input.Set("axis_z", 4); | ||
| 153 | new_input.Set("range", 1.0f); | ||
| 154 | new_input.Set("deadzone", 0.0f); | ||
| 155 | input_queue.Push(new_input); | ||
| 156 | return; | ||
| 157 | } | ||
| 158 | |||
| 146 | switch (data.type) { | 159 | switch (data.type) { |
| 147 | case EngineInputType::Button: | 160 | case EngineInputType::Button: |
| 148 | case EngineInputType::HatButton: | 161 | case EngineInputType::HatButton: |