input_common: Implement dedicated motion from mouse

This commit is contained in:
Narr the Reg
2023-02-21 21:46:42 -06:00
parent 8f3e2a1b48
commit 673accd630
3 changed files with 85 additions and 24 deletions

View File

@ -142,14 +142,10 @@ 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);
input_queue.Push(new_input);
return;
}