input_common: Move button names to the frontend

This commit is contained in:
german77 authored and Narr the Reg committed 2021-11-24 20:30:28 -06:00
1 parent bc9641614d
commit b8b849dc2e
12 files changed
+160 -52

No files matched your search

+5
View File
@@ -61,6 +61,7 @@ void MappingFactory::RegisterButton(const MappingData& data) {
}
new_input.Set("port", static_cast<int>(data.pad.port));
new_input.Set("pad", static_cast<int>(data.pad.pad));
switch (data.type) {
case EngineInputType::Button:
// Workaround for old compatibility
@@ -75,6 +76,10 @@ void MappingFactory::RegisterButton(const MappingData& data) {
new_input.Set("direction", data.hat_name);
break;
case EngineInputType::Analog:
// Ignore mouse axis when mapping buttons
if (data.engine == "mouse") {
return;
}
new_input.Set("axis", data.index);
new_input.Set("threshold", 0.5f);
break;