input_common: Reintroduce motion from mouse and use button names

This commit is contained in:
german77 2022-01-16 18:03:11 -06:00
parent 0e12a27299
commit 991460cd98
5 changed files with 64 additions and 1 deletions

View file

@ -143,6 +143,19 @@ 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 (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);
input_queue.Push(new_input);
return;
}
switch (data.type) {
case EngineInputType::Button:
case EngineInputType::HatButton: