diff options
Diffstat (limited to 'src/input_common/input_mapping.cpp')
| -rw-r--r-- | src/input_common/input_mapping.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/input_common/input_mapping.cpp b/src/input_common/input_mapping.cpp index d6e49d2c5..8c2ee4eb3 100644 --- a/src/input_common/input_mapping.cpp +++ b/src/input_common/input_mapping.cpp | |||
| @@ -82,6 +82,9 @@ void MappingFactory::RegisterButton(const MappingData& data) { | |||
| 82 | new_input.Set("axis", data.index); | 82 | new_input.Set("axis", data.index); |
| 83 | new_input.Set("threshold", 0.5f); | 83 | new_input.Set("threshold", 0.5f); |
| 84 | break; | 84 | break; |
| 85 | case EngineInputType::Motion: | ||
| 86 | new_input.Set("motion", data.index); | ||
| 87 | break; | ||
| 85 | default: | 88 | default: |
| 86 | return; | 89 | return; |
| 87 | } | 90 | } |
| @@ -142,14 +145,11 @@ void MappingFactory::RegisterMotion(const MappingData& data) { | |||
| 142 | new_input.Set("port", static_cast<int>(data.pad.port)); | 145 | new_input.Set("port", static_cast<int>(data.pad.port)); |
| 143 | new_input.Set("pad", static_cast<int>(data.pad.pad)); | 146 | new_input.Set("pad", static_cast<int>(data.pad.pad)); |
| 144 | 147 | ||
| 145 | // If engine is mouse map the mouse position as 3 axis motion | 148 | // If engine is mouse map it automatically to mouse motion |
| 146 | if (data.engine == "mouse") { | 149 | if (data.engine == "mouse") { |
| 147 | new_input.Set("axis_x", 1); | 150 | new_input.Set("motion", 0); |
| 148 | new_input.Set("invert_x", "-"); | 151 | new_input.Set("pad", 1); |
| 149 | new_input.Set("axis_y", 0); | 152 | new_input.Set("threshold", 0.001f); |
| 150 | new_input.Set("axis_z", 4); | ||
| 151 | new_input.Set("range", 1.0f); | ||
| 152 | new_input.Set("deadzone", 0.0f); | ||
| 153 | input_queue.Push(new_input); | 153 | input_queue.Push(new_input); |
| 154 | return; | 154 | return; |
| 155 | } | 155 | } |
| @@ -194,6 +194,10 @@ bool MappingFactory::IsDriverValid(const MappingData& data) const { | |||
| 194 | if (data.engine == "keyboard" && data.pad.port != 0) { | 194 | if (data.engine == "keyboard" && data.pad.port != 0) { |
| 195 | return false; | 195 | return false; |
| 196 | } | 196 | } |
| 197 | // Only port 0 can be mapped on the mouse | ||
| 198 | if (data.engine == "mouse" && data.pad.port != 0) { | ||
| 199 | return false; | ||
| 200 | } | ||
| 197 | // To prevent mapping with two devices we disable any UDP except motion | 201 | // To prevent mapping with two devices we disable any UDP except motion |
| 198 | if (!Settings::values.enable_udp_controller && data.engine == "cemuhookudp" && | 202 | if (!Settings::values.enable_udp_controller && data.engine == "cemuhookudp" && |
| 199 | data.type != EngineInputType::Motion) { | 203 | data.type != EngineInputType::Motion) { |