input_common: Move button names to the frontend

This commit is contained in:
german77 2021-11-21 14:12:01 -06:00 committed by Narr the Reg
parent c4760489a0
commit 746c85b560
12 changed files with 160 additions and 52 deletions

View file

@ -171,12 +171,15 @@ AnalogMapping Mouse::GetAnalogMappingForDevice(
return mapping;
}
std::string Mouse::GetUIName(const Common::ParamPackage& params) const {
Common::Input::ButtonNames Mouse::GetUIName(const Common::ParamPackage& params) const {
if (params.Has("button")) {
return fmt::format("Mouse {}", params.Get("button", 0));
return Common::Input::ButtonNames::Value;
}
if (params.Has("axis")) {
return Common::Input::ButtonNames::Value;
}
return "Bad Mouse";
return Common::Input::ButtonNames::Invalid;
}
} // namespace InputCommon