Logitech G27 cleanup
This commit is contained in:
@@ -5,18 +5,52 @@
|
||||
#include "Utilities/File.h"
|
||||
#include "LogitechG27Config.h"
|
||||
|
||||
template <>
|
||||
void fmt_class_string<sdl_mapping_type>::format(std::string& out, u64 arg)
|
||||
{
|
||||
format_enum(out, arg, [](sdl_mapping_type value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case sdl_mapping_type::button: return "button";
|
||||
case sdl_mapping_type::hat: return "hat";
|
||||
case sdl_mapping_type::axis: return "axis";
|
||||
}
|
||||
|
||||
return unknown;
|
||||
});
|
||||
}
|
||||
|
||||
template <>
|
||||
void fmt_class_string<hat_component>::format(std::string& out, u64 arg)
|
||||
{
|
||||
format_enum(out, arg, [](hat_component value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case hat_component::up: return "up";
|
||||
case hat_component::down: return "down";
|
||||
case hat_component::left: return "left";
|
||||
case hat_component::right: return "right";
|
||||
case hat_component::none: return "";
|
||||
}
|
||||
|
||||
return unknown;
|
||||
});
|
||||
}
|
||||
|
||||
emulated_logitech_g27_config g_cfg_logitech_g27;
|
||||
|
||||
LOG_CHANNEL(cfg_log, "CFG");
|
||||
|
||||
emulated_logitech_g27_config::emulated_logitech_g27_config()
|
||||
: m_path(fmt::format("%s%s.yml", fs::get_config_dir(true), "LogitechG27"))
|
||||
: m_path(fs::get_config_dir(true) + "LogitechG27.yml")
|
||||
{
|
||||
}
|
||||
|
||||
void emulated_logitech_g27_config::reset()
|
||||
{
|
||||
const std::lock_guard<std::mutex> lock(m_mutex);
|
||||
const std::lock_guard lock(m_mutex);
|
||||
cfg::node::from_default();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user