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) { new_input.Set("axis", data.index); new_input.Set("threshold", 0.5f); break; + case EngineInputType::Motion: + new_input.Set("motion", data.index); + break; default: return; } @@ -142,14 +145,11 @@ void MappingFactory::RegisterMotion(const MappingData& data) { new_input.Set("port", static_cast<int>(data.pad.port)); new_input.Set("pad", static_cast<int>(data.pad.pad)); - // If engine is mouse map the mouse position as 3 axis motion + // If engine is mouse map it automatically to mouse motion if (data.engine == "mouse") { - new_input.Set("axis_x", 1); - new_input.Set("invert_x", "-"); - new_input.Set("axis_y", 0); - new_input.Set("axis_z", 4); - new_input.Set("range", 1.0f); - new_input.Set("deadzone", 0.0f); + new_input.Set("motion", 0); + new_input.Set("pad", 1); + new_input.Set("threshold", 0.001f); input_queue.Push(new_input); return; } @@ -194,6 +194,10 @@ bool MappingFactory::IsDriverValid(const MappingData& data) const { if (data.engine == "keyboard" && data.pad.port != 0) { return false; } + // Only port 0 can be mapped on the mouse + if (data.engine == "mouse" && data.pad.port != 0) { + return false; + } // To prevent mapping with two devices we disable any UDP except motion if (!Settings::values.enable_udp_controller && data.engine == "cemuhookudp" && data.type != EngineInputType::Motion) { |