rpcsx/rpcs3/Input/raw_mouse_config.h

48 lines
1.2 KiB
C
Raw Normal View History

2024-02-05 23:49:00 +01:00
#pragma once
#include "Utilities/Config.h"
#include "Utilities/mutex.h"
#include <array>
LOG_CHANNEL(cfg_log, "CFG");
std::string mouse_button_id(int code);
2024-02-05 23:49:00 +01:00
struct raw_mouse_config : cfg::node
{
public:
using cfg::node::node;
cfg::string device{this, "Device", ""};
2024-02-05 23:49:00 +01:00
cfg::_float<10, 1000> mouse_acceleration{ this, "Mouse Acceleration", 100.0f, true };
2020-12-24 13:48:22 +01:00
cfg::string mouse_button_1{ this, "Button 1", "Button 1", true };
cfg::string mouse_button_2{ this, "Button 2", "Button 2", true };
cfg::string mouse_button_3{ this, "Button 3", "Button 3", true };
cfg::string mouse_button_4{ this, "Button 4", "Button 4", true };
cfg::string mouse_button_5{ this, "Button 5", "Button 5", true };
cfg::string mouse_button_6{ this, "Button 6", "", true };
cfg::string mouse_button_7{ this, "Button 7", "", true };
cfg::string mouse_button_8{ this, "Button 8", "", true };
2020-12-24 13:48:22 +01:00
cfg::string& get_button_by_index(int index);
2020-12-24 13:48:22 +01:00
cfg::string& get_button(int code);
2024-02-05 23:49:00 +01:00
};
struct raw_mice_config : cfg::node
{
2020-12-24 13:48:22 +01:00
raw_mice_config();
2024-02-05 23:49:00 +01:00
shared_mutex m_mutex;
static constexpr std::string_view cfg_id = "raw_mouse";
std::array<std::shared_ptr<raw_mouse_config>, 4> players;
atomic_t<bool> reload_requested = false;
2024-02-05 23:49:00 +01:00
2020-12-24 13:48:22 +01:00
bool load();
void save();
2024-02-05 23:49:00 +01:00
};
extern raw_mice_config g_cfg_raw_mouse;