remove old bindings format support

This commit is contained in:
MihailRis
2024-06-07 14:13:49 +03:00
parent 27cb5f6e51
commit 14911aa30f
5 changed files with 0 additions and 39 deletions
-25
View File
@@ -182,31 +182,6 @@ std::string Events::writeBindings() {
return toml::stringify(obj);
}
void Events::loadBindingsOld(const std::string& filename, const std::string& source) {
auto obj = json::parse(filename, source);
for (auto& entry : Events::bindings) {
auto& binding = entry.second;
auto jentry = obj->map(entry.first);
if (jentry == nullptr)
continue;
inputtype type;
std::string typestr;
jentry->str("type", typestr);
if (typestr == "keyboard") {
type = inputtype::keyboard;
} else if (typestr == "mouse") {
type = inputtype::mouse;
} else {
logger.error() << "unknown input type '" << typestr << "'";
continue;
}
binding.type = type;
jentry->num("code", binding.code);
}
}
void Events::loadBindings(const std::string& filename, const std::string& source) {
auto map = toml::parse(filename, source);
for (auto& entry : map->values) {
-1
View File
@@ -53,7 +53,6 @@ public:
static std::string writeBindings();
static void loadBindings(const std::string& filename, const std::string& source);
static void loadBindingsOld(const std::string& filename, const std::string& source); // TODO: remove in 0.22
};
#endif // WINDOW_EVENTS_HPP_