mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-14 02:38:37 +12:00
clang format pass
This commit is contained in:
parent
dc25f9e08e
commit
0729f7d078
10 changed files with 1225 additions and 1214 deletions
|
@ -211,11 +211,11 @@ private:
|
||||||
|
|
||||||
|
|
||||||
// GT5 Wheels&co
|
// GT5 Wheels&co
|
||||||
#ifdef HAVE_SDL3
|
#ifdef HAVE_SDL3
|
||||||
{0x046D, 0xC283, 0xC29B, "lgFF_c283_c29b", &usb_device_logitech_g27::get_num_emu_devices, &usb_device_logitech_g27::make_instance},
|
{0x046D, 0xC283, 0xC29B, "lgFF_c283_c29b", &usb_device_logitech_g27::get_num_emu_devices, &usb_device_logitech_g27::make_instance},
|
||||||
#else
|
#else
|
||||||
{0x046D, 0xC283, 0xC29B, "lgFF_c283_c29b", nullptr, nullptr},
|
{0x046D, 0xC283, 0xC29B, "lgFF_c283_c29b", nullptr, nullptr},
|
||||||
#endif
|
#endif
|
||||||
{0x044F, 0xB653, 0xB653, "Thrustmaster RGT FFB Pro", nullptr, nullptr},
|
{0x044F, 0xB653, 0xB653, "Thrustmaster RGT FFB Pro", nullptr, nullptr},
|
||||||
{0x044F, 0xB65A, 0xB65A, "Thrustmaster F430", nullptr, nullptr},
|
{0x044F, 0xB65A, 0xB65A, "Thrustmaster F430", nullptr, nullptr},
|
||||||
{0x044F, 0xB65D, 0xB65D, "Thrustmaster FFB", nullptr, nullptr},
|
{0x044F, 0xB65D, 0xB65D, "Thrustmaster FFB", nullptr, nullptr},
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -116,8 +116,9 @@ public:
|
||||||
std::mutex thread_control_mutex;
|
std::mutex thread_control_mutex;
|
||||||
bool stop_thread;
|
bool stop_thread;
|
||||||
char thread_name[64];
|
char thread_name[64];
|
||||||
SDL_Thread *thread = nullptr;
|
SDL_Thread* thread = nullptr;
|
||||||
void sdl_refresh();
|
void sdl_refresh();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
u32 m_controller_index;
|
u32 m_controller_index;
|
||||||
|
|
||||||
|
@ -125,9 +126,9 @@ private:
|
||||||
bool reverse_effects;
|
bool reverse_effects;
|
||||||
|
|
||||||
std::mutex sdl_handles_mutex;
|
std::mutex sdl_handles_mutex;
|
||||||
SDL_Joystick *led_joystick_handle = nullptr;
|
SDL_Joystick* led_joystick_handle = nullptr;
|
||||||
SDL_Haptic *haptic_handle = nullptr;
|
SDL_Haptic* haptic_handle = nullptr;
|
||||||
std::map<uint32_t, std::vector<SDL_Joystick *>> joysticks;
|
std::map<uint32_t, std::vector<SDL_Joystick*>> joysticks;
|
||||||
bool fixed_loop = false;
|
bool fixed_loop = false;
|
||||||
uint16_t wheel_range = 200;
|
uint16_t wheel_range = 200;
|
||||||
logitech_g27_ffb_slot effect_slots[4];
|
logitech_g27_ffb_slot effect_slots[4];
|
||||||
|
|
|
@ -10,17 +10,18 @@ emulated_logitech_g27_config g_cfg_logitech_g27;
|
||||||
|
|
||||||
LOG_CHANNEL(cfg_log, "CFG");
|
LOG_CHANNEL(cfg_log, "CFG");
|
||||||
|
|
||||||
void emulated_logitech_g27_config::fill_defaults(){
|
void emulated_logitech_g27_config::fill_defaults()
|
||||||
|
{
|
||||||
// a shifter-less g29 with a xbox 360 controller shifter place holder...
|
// a shifter-less g29 with a xbox 360 controller shifter place holder...
|
||||||
m_mutex.lock();
|
m_mutex.lock();
|
||||||
|
|
||||||
#define INIT_AXIS_MAPPING(name, device_type_id, id, reverse) \
|
#define INIT_AXIS_MAPPING(name, device_type_id, id, reverse) \
|
||||||
{ \
|
{ \
|
||||||
name##_device_type_id.set(device_type_id); \
|
name##_device_type_id.set(device_type_id); \
|
||||||
name##_type.set(MAPPING_AXIS); \
|
name##_type.set(MAPPING_AXIS); \
|
||||||
name##_id.set(id); \
|
name##_id.set(id); \
|
||||||
name##_hat.set(HAT_NONE); \
|
name##_hat.set(HAT_NONE); \
|
||||||
name##_reverse.set(reverse); \
|
name##_reverse.set(reverse); \
|
||||||
}
|
}
|
||||||
|
|
||||||
INIT_AXIS_MAPPING(steering, 0x046dc24f, 0, false);
|
INIT_AXIS_MAPPING(steering, 0x046dc24f, 0, false);
|
||||||
|
@ -28,15 +29,15 @@ void emulated_logitech_g27_config::fill_defaults(){
|
||||||
INIT_AXIS_MAPPING(brake, 0x046dc24f, 3, false);
|
INIT_AXIS_MAPPING(brake, 0x046dc24f, 3, false);
|
||||||
INIT_AXIS_MAPPING(clutch, 0x046dc24f, 1, false);
|
INIT_AXIS_MAPPING(clutch, 0x046dc24f, 1, false);
|
||||||
|
|
||||||
#undef INIT_AXIS_MAPPING
|
#undef INIT_AXIS_MAPPING
|
||||||
|
|
||||||
#define INIT_BUTTON_MAPPING(name, device_type_id, id, reverse) \
|
#define INIT_BUTTON_MAPPING(name, device_type_id, id, reverse) \
|
||||||
{ \
|
{ \
|
||||||
name##_device_type_id.set(device_type_id); \
|
name##_device_type_id.set(device_type_id); \
|
||||||
name##_type.set(MAPPING_BUTTON); \
|
name##_type.set(MAPPING_BUTTON); \
|
||||||
name##_id.set(id); \
|
name##_id.set(id); \
|
||||||
name##_hat.set(HAT_NONE); \
|
name##_hat.set(HAT_NONE); \
|
||||||
name##_reverse.set(reverse); \
|
name##_reverse.set(reverse); \
|
||||||
}
|
}
|
||||||
|
|
||||||
INIT_BUTTON_MAPPING(shift_up, 0x046dc24f, 4, false);
|
INIT_BUTTON_MAPPING(shift_up, 0x046dc24f, 4, false);
|
||||||
|
@ -66,15 +67,15 @@ void emulated_logitech_g27_config::fill_defaults(){
|
||||||
INIT_BUTTON_MAPPING(shifter_3, 0x045e028e, 2, false);
|
INIT_BUTTON_MAPPING(shifter_3, 0x045e028e, 2, false);
|
||||||
INIT_BUTTON_MAPPING(shifter_4, 0x045e028e, 1, false);
|
INIT_BUTTON_MAPPING(shifter_4, 0x045e028e, 1, false);
|
||||||
|
|
||||||
#undef INIT_BUTTON_MAPPING
|
#undef INIT_BUTTON_MAPPING
|
||||||
|
|
||||||
#define INIT_HAT_MAPPING(name, device_type_id, id, hat, reverse) \
|
#define INIT_HAT_MAPPING(name, device_type_id, id, hat, reverse) \
|
||||||
{ \
|
{ \
|
||||||
name##_device_type_id.set(device_type_id); \
|
name##_device_type_id.set(device_type_id); \
|
||||||
name##_type.set(MAPPING_HAT); \
|
name##_type.set(MAPPING_HAT); \
|
||||||
name##_id.set(id); \
|
name##_id.set(id); \
|
||||||
name##_hat.set(hat); \
|
name##_hat.set(hat); \
|
||||||
name##_reverse.set(reverse); \
|
name##_reverse.set(reverse); \
|
||||||
}
|
}
|
||||||
|
|
||||||
INIT_HAT_MAPPING(up, 0x046dc24f, 0, HAT_UP, false);
|
INIT_HAT_MAPPING(up, 0x046dc24f, 0, HAT_UP, false);
|
||||||
|
@ -86,7 +87,7 @@ void emulated_logitech_g27_config::fill_defaults(){
|
||||||
INIT_HAT_MAPPING(shifter_6, 0x045e028e, 0, HAT_DOWN, false);
|
INIT_HAT_MAPPING(shifter_6, 0x045e028e, 0, HAT_DOWN, false);
|
||||||
INIT_HAT_MAPPING(shifter_r, 0x045e028e, 0, HAT_LEFT, false);
|
INIT_HAT_MAPPING(shifter_r, 0x045e028e, 0, HAT_LEFT, false);
|
||||||
|
|
||||||
#undef INIT_HAT_MAPPING
|
#undef INIT_HAT_MAPPING
|
||||||
|
|
||||||
reverse_effects.set(true);
|
reverse_effects.set(true);
|
||||||
ffb_device_type_id.set(0x046dc24f);
|
ffb_device_type_id.set(0x046dc24f);
|
||||||
|
@ -97,7 +98,8 @@ void emulated_logitech_g27_config::fill_defaults(){
|
||||||
m_mutex.unlock();
|
m_mutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void emulated_logitech_g27_config::save(){
|
void emulated_logitech_g27_config::save()
|
||||||
|
{
|
||||||
m_mutex.lock();
|
m_mutex.lock();
|
||||||
const std::string cfg_name = fmt::format("%s%s.yml", fs::get_config_dir(true), "LogitechG27");
|
const std::string cfg_name = fmt::format("%s%s.yml", fs::get_config_dir(true), "LogitechG27");
|
||||||
cfg_log.notice("Saving LogitechG27 config: %s", cfg_name);
|
cfg_log.notice("Saving LogitechG27 config: %s", cfg_name);
|
||||||
|
@ -112,7 +114,6 @@ void emulated_logitech_g27_config::save(){
|
||||||
cfg_log.error("Failed to save LogitechG27 config to '%s' (error=%s)", cfg_name, fs::g_tls_error);
|
cfg_log.error("Failed to save LogitechG27 config to '%s' (error=%s)", cfg_name, fs::g_tls_error);
|
||||||
}
|
}
|
||||||
m_mutex.unlock();
|
m_mutex.unlock();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool emulated_logitech_g27_config::load()
|
bool emulated_logitech_g27_config::load()
|
||||||
|
@ -125,7 +126,7 @@ bool emulated_logitech_g27_config::load()
|
||||||
|
|
||||||
m_mutex.lock();
|
m_mutex.lock();
|
||||||
|
|
||||||
if (fs::file cfg_file{ cfg_name, fs::read })
|
if (fs::file cfg_file{cfg_name, fs::read})
|
||||||
{
|
{
|
||||||
if (const std::string content = cfg_file.to_string(); !content.empty())
|
if (const std::string content = cfg_file.to_string(); !content.empty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,19 +4,20 @@
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
struct emulated_logitech_g27_config : cfg::node {
|
struct emulated_logitech_g27_config : cfg::node
|
||||||
|
{
|
||||||
std::mutex m_mutex;
|
std::mutex m_mutex;
|
||||||
bool load();
|
bool load();
|
||||||
void save();
|
void save();
|
||||||
void fill_defaults();
|
void fill_defaults();
|
||||||
|
|
||||||
#define STR(s) #s
|
#define STR(s) #s
|
||||||
#define MAPPING_ENTRY(name) \
|
#define MAPPING_ENTRY(name) \
|
||||||
cfg::uint<0, 0xFFFFFFFF> name##_device_type_id{this, STR(name##_device_type_id)}; \
|
cfg::uint<0, 0xFFFFFFFF> name##_device_type_id{this, STR(name##_device_type_id)}; \
|
||||||
cfg::uint<0, 0xFFFFFFFF> name##_type{this, STR(name##_type)}; \
|
cfg::uint<0, 0xFFFFFFFF> name##_type{this, STR(name##_type)}; \
|
||||||
cfg::uint<0, 0xFFFFFFFFFFFFFFFF> name##_id{this, STR(name##_id)}; \
|
cfg::uint<0, 0xFFFFFFFFFFFFFFFF> name##_id{this, STR(name##_id)}; \
|
||||||
cfg::uint<0, 0xFFFFFFFF> name##_hat{this, STR(name##_hat)}; \
|
cfg::uint<0, 0xFFFFFFFF> name##_hat{this, STR(name##_hat)}; \
|
||||||
cfg::_bool name##_reverse{this, STR(name##_reverse)};
|
cfg::_bool name##_reverse{this, STR(name##_reverse)};
|
||||||
|
|
||||||
MAPPING_ENTRY(steering);
|
MAPPING_ENTRY(steering);
|
||||||
MAPPING_ENTRY(throttle);
|
MAPPING_ENTRY(throttle);
|
||||||
|
@ -57,8 +58,8 @@ struct emulated_logitech_g27_config : cfg::node {
|
||||||
MAPPING_ENTRY(shifter_6);
|
MAPPING_ENTRY(shifter_6);
|
||||||
MAPPING_ENTRY(shifter_r);
|
MAPPING_ENTRY(shifter_r);
|
||||||
|
|
||||||
#undef MAPPING_ENTRY
|
#undef MAPPING_ENTRY
|
||||||
#undef STR
|
#undef STR
|
||||||
|
|
||||||
cfg::_bool reverse_effects{this, "reverse_effects"};
|
cfg::_bool reverse_effects{this, "reverse_effects"};
|
||||||
cfg::uint<0, 0xFFFFFFFF> ffb_device_type_id{this, "ffb_device_type_id"};
|
cfg::uint<0, 0xFFFFFFFF> ffb_device_type_id{this, "ffb_device_type_id"};
|
||||||
|
|
|
@ -22,7 +22,7 @@ sdl_instance::~sdl_instance()
|
||||||
|
|
||||||
sdl_instance& sdl_instance::get_instance()
|
sdl_instance& sdl_instance::get_instance()
|
||||||
{
|
{
|
||||||
static sdl_instance instance {};
|
static sdl_instance instance{};
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,64 +61,65 @@ bool sdl_instance::initialize()
|
||||||
|
|
||||||
SDL_SetLogPriorities(SDL_LOG_PRIORITY_VERBOSE);
|
SDL_SetLogPriorities(SDL_LOG_PRIORITY_VERBOSE);
|
||||||
SDL_SetLogOutputFunction([](void*, int category, SDL_LogPriority priority, const char* message)
|
SDL_SetLogOutputFunction([](void*, int category, SDL_LogPriority priority, const char* message)
|
||||||
{
|
|
||||||
std::string category_name;
|
|
||||||
switch (category)
|
|
||||||
{
|
{
|
||||||
case SDL_LOG_CATEGORY_APPLICATION:
|
std::string category_name;
|
||||||
category_name = "app";
|
switch (category)
|
||||||
break;
|
{
|
||||||
case SDL_LOG_CATEGORY_ERROR:
|
case SDL_LOG_CATEGORY_APPLICATION:
|
||||||
category_name = "error";
|
category_name = "app";
|
||||||
break;
|
break;
|
||||||
case SDL_LOG_CATEGORY_ASSERT:
|
case SDL_LOG_CATEGORY_ERROR:
|
||||||
category_name = "assert";
|
category_name = "error";
|
||||||
break;
|
break;
|
||||||
case SDL_LOG_CATEGORY_SYSTEM:
|
case SDL_LOG_CATEGORY_ASSERT:
|
||||||
category_name = "system";
|
category_name = "assert";
|
||||||
break;
|
break;
|
||||||
case SDL_LOG_CATEGORY_AUDIO:
|
case SDL_LOG_CATEGORY_SYSTEM:
|
||||||
category_name = "audio";
|
category_name = "system";
|
||||||
break;
|
break;
|
||||||
case SDL_LOG_CATEGORY_VIDEO:
|
case SDL_LOG_CATEGORY_AUDIO:
|
||||||
category_name = "video";
|
category_name = "audio";
|
||||||
break;
|
break;
|
||||||
case SDL_LOG_CATEGORY_RENDER:
|
case SDL_LOG_CATEGORY_VIDEO:
|
||||||
category_name = "render";
|
category_name = "video";
|
||||||
break;
|
break;
|
||||||
case SDL_LOG_CATEGORY_INPUT:
|
case SDL_LOG_CATEGORY_RENDER:
|
||||||
category_name = "input";
|
category_name = "render";
|
||||||
break;
|
break;
|
||||||
case SDL_LOG_CATEGORY_TEST:
|
case SDL_LOG_CATEGORY_INPUT:
|
||||||
category_name = "test";
|
category_name = "input";
|
||||||
break;
|
break;
|
||||||
default:
|
case SDL_LOG_CATEGORY_TEST:
|
||||||
category_name = fmt::format("unknown(%d)", category);
|
category_name = "test";
|
||||||
break;
|
break;
|
||||||
}
|
default:
|
||||||
|
category_name = fmt::format("unknown(%d)", category);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch (priority)
|
switch (priority)
|
||||||
{
|
{
|
||||||
case SDL_LOG_PRIORITY_VERBOSE:
|
case SDL_LOG_PRIORITY_VERBOSE:
|
||||||
case SDL_LOG_PRIORITY_DEBUG:
|
case SDL_LOG_PRIORITY_DEBUG:
|
||||||
sdl_log.trace("%s: %s", category_name, message);
|
sdl_log.trace("%s: %s", category_name, message);
|
||||||
break;
|
break;
|
||||||
case SDL_LOG_PRIORITY_INFO:
|
case SDL_LOG_PRIORITY_INFO:
|
||||||
sdl_log.notice("%s: %s", category_name, message);
|
sdl_log.notice("%s: %s", category_name, message);
|
||||||
break;
|
break;
|
||||||
case SDL_LOG_PRIORITY_WARN:
|
case SDL_LOG_PRIORITY_WARN:
|
||||||
sdl_log.warning("%s: %s", category_name, message);
|
sdl_log.warning("%s: %s", category_name, message);
|
||||||
break;
|
break;
|
||||||
case SDL_LOG_PRIORITY_ERROR:
|
case SDL_LOG_PRIORITY_ERROR:
|
||||||
sdl_log.error("%s: %s", category_name, message);
|
sdl_log.error("%s: %s", category_name, message);
|
||||||
break;
|
break;
|
||||||
case SDL_LOG_PRIORITY_CRITICAL:
|
case SDL_LOG_PRIORITY_CRITICAL:
|
||||||
sdl_log.error("%s: %s", category_name, message);
|
sdl_log.error("%s: %s", category_name, message);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}, nullptr);
|
},
|
||||||
|
nullptr);
|
||||||
|
|
||||||
m_initialized = true;
|
m_initialized = true;
|
||||||
instance_mutex.unlock();
|
instance_mutex.unlock();
|
||||||
|
|
|
@ -12,6 +12,7 @@ public:
|
||||||
|
|
||||||
bool initialize();
|
bool initialize();
|
||||||
void pump_events();
|
void pump_events();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_initialized = false;
|
bool m_initialized = false;
|
||||||
std::mutex instance_mutex;
|
std::mutex instance_mutex;
|
||||||
|
|
|
@ -22,7 +22,7 @@ add_library(rpcs3_ui STATIC
|
||||||
emu_settings.cpp
|
emu_settings.cpp
|
||||||
elf_memory_dumping_dialog.cpp
|
elf_memory_dumping_dialog.cpp
|
||||||
emulated_pad_settings_dialog.cpp
|
emulated_pad_settings_dialog.cpp
|
||||||
emulated_logitech_g27_settings_dialog.cpp
|
emulated_logitech_g27_settings_dialog.cpp
|
||||||
fatal_error_dialog.cpp
|
fatal_error_dialog.cpp
|
||||||
find_dialog.cpp
|
find_dialog.cpp
|
||||||
flow_layout.cpp
|
flow_layout.cpp
|
||||||
|
|
|
@ -20,7 +20,8 @@ LOG_CHANNEL(logitech_g27_cfg_log, "LOGIG27");
|
||||||
|
|
||||||
#define DEFAULT_STATUS " "
|
#define DEFAULT_STATUS " "
|
||||||
|
|
||||||
struct joystick_state {
|
struct joystick_state
|
||||||
|
{
|
||||||
std::vector<int16_t> axes;
|
std::vector<int16_t> axes;
|
||||||
std::vector<bool> buttons;
|
std::vector<bool> buttons;
|
||||||
std::vector<hat_component> hats;
|
std::vector<hat_component> hats;
|
||||||
|
@ -30,14 +31,14 @@ class DeviceChoice : public QWidget
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DeviceChoice(QWidget *parent, uint32_t device_type_id, const char *name)
|
DeviceChoice(QWidget* parent, uint32_t device_type_id, const char* name)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
this->device_type_id = device_type_id;
|
this->device_type_id = device_type_id;
|
||||||
|
|
||||||
auto layout = new QHBoxLayout(this);
|
auto layout = new QHBoxLayout(this);
|
||||||
|
|
||||||
QLabel *label = new QLabel(this);
|
QLabel* label = new QLabel(this);
|
||||||
label->setText(QString(name));
|
label->setText(QString(name));
|
||||||
layout->addWidget(label);
|
layout->addWidget(label);
|
||||||
|
|
||||||
|
@ -64,8 +65,9 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint32_t device_type_id;
|
uint32_t device_type_id;
|
||||||
QLabel *display_box;
|
QLabel* display_box;
|
||||||
void update_display(){
|
void update_display()
|
||||||
|
{
|
||||||
char text_buf[32];
|
char text_buf[32];
|
||||||
sprintf(text_buf, "%04x:%04x", device_type_id >> 16, device_type_id & 0xFFFF);
|
sprintf(text_buf, "%04x:%04x", device_type_id >> 16, device_type_id & 0xFFFF);
|
||||||
display_box->setText(QString(text_buf));
|
display_box->setText(QString(text_buf));
|
||||||
|
@ -76,7 +78,7 @@ class Mapping : public QGroupBox
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Mapping(QWidget *parent, emulated_logitech_g27_settings_dialog *dialog, DeviceChoice *ffb_device, DeviceChoice *led_device, sdl_mapping mapping, bool is_axis, const char *name, bool flip_axis_display)
|
Mapping(QWidget* parent, emulated_logitech_g27_settings_dialog* dialog, DeviceChoice* ffb_device, DeviceChoice* led_device, sdl_mapping mapping, bool is_axis, const char* name, bool flip_axis_display)
|
||||||
: QGroupBox(parent)
|
: QGroupBox(parent)
|
||||||
{
|
{
|
||||||
this->setting_dialog = dialog;
|
this->setting_dialog = dialog;
|
||||||
|
@ -88,16 +90,16 @@ public:
|
||||||
this->mapping_in_progress = false;
|
this->mapping_in_progress = false;
|
||||||
this->flip_axis_display = flip_axis_display;
|
this->flip_axis_display = flip_axis_display;
|
||||||
|
|
||||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
|
||||||
QWidget *horizontal_container = new QWidget(this);
|
QWidget* horizontal_container = new QWidget(this);
|
||||||
QHBoxLayout *horizontal_layout = new QHBoxLayout(horizontal_container);
|
QHBoxLayout* horizontal_layout = new QHBoxLayout(horizontal_container);
|
||||||
horizontal_container->setLayout(horizontal_layout);
|
horizontal_container->setLayout(horizontal_layout);
|
||||||
|
|
||||||
layout->addWidget(horizontal_container);
|
layout->addWidget(horizontal_container);
|
||||||
|
|
||||||
QLabel *label = new QLabel(horizontal_container);
|
QLabel* label = new QLabel(horizontal_container);
|
||||||
label->setText(QString(name));
|
label->setText(QString(name));
|
||||||
|
|
||||||
display_box = new QLabel(horizontal_container);
|
display_box = new QLabel(horizontal_container);
|
||||||
|
@ -144,131 +146,134 @@ public:
|
||||||
layout->addWidget(axis_status);
|
layout->addWidget(axis_status);
|
||||||
|
|
||||||
connect(ffb_set_button, &QPushButton::clicked, this, [this]()
|
connect(ffb_set_button, &QPushButton::clicked, this, [this]()
|
||||||
{
|
{
|
||||||
this->ffb_device->set_device_type_id(this->mapping.device_type_id);
|
this->ffb_device->set_device_type_id(this->mapping.device_type_id);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(led_set_button, &QPushButton::clicked, this, [this]()
|
connect(led_set_button, &QPushButton::clicked, this, [this]()
|
||||||
{
|
{
|
||||||
this->led_device->set_device_type_id(this->mapping.device_type_id);
|
this->led_device->set_device_type_id(this->mapping.device_type_id);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(map_button, &QPushButton::clicked, this, [this](){
|
connect(map_button, &QPushButton::clicked, this, [this]()
|
||||||
this->mapping_in_progress = true;
|
{
|
||||||
this->timeout_msec = 5500;
|
this->mapping_in_progress = true;
|
||||||
this->setting_dialog->disable();
|
this->timeout_msec = 5500;
|
||||||
this->last_joystick_states = this->setting_dialog->get_joystick_states();
|
this->setting_dialog->disable();
|
||||||
});
|
this->last_joystick_states = this->setting_dialog->get_joystick_states();
|
||||||
|
});
|
||||||
|
|
||||||
connect(unmap_button, &QPushButton::clicked, this, [this](){
|
connect(unmap_button, &QPushButton::clicked, this, [this]()
|
||||||
this->mapping.device_type_id = 0;
|
{
|
||||||
update_display();
|
this->mapping.device_type_id = 0;
|
||||||
});
|
update_display();
|
||||||
|
});
|
||||||
|
|
||||||
connect(reverse_checkbox, &QCheckBox::clicked, this, [this](){
|
connect(reverse_checkbox, &QCheckBox::clicked, this, [this]()
|
||||||
this->mapping.reverse = this->reverse_checkbox->isChecked();
|
{
|
||||||
});
|
this->mapping.reverse = this->reverse_checkbox->isChecked();
|
||||||
|
});
|
||||||
|
|
||||||
tick_timer = new QTimer(this);
|
tick_timer = new QTimer(this);
|
||||||
connect(tick_timer, &QTimer::timeout, this, [this]()
|
connect(tick_timer, &QTimer::timeout, this, [this]()
|
||||||
{
|
|
||||||
if (this->mapping_in_progress)
|
|
||||||
{
|
{
|
||||||
char text_buf[128];
|
if (this->mapping_in_progress)
|
||||||
|
|
||||||
int timeout_sec = this->timeout_msec / 1000;
|
|
||||||
|
|
||||||
const std::map<uint32_t, joystick_state> &new_joystick_states = this->setting_dialog->get_joystick_states();
|
|
||||||
|
|
||||||
sprintf(text_buf, "Input %s for %s, timeout in %d %s", this->is_axis ? "axis" : "button/hat", this->name.c_str(), timeout_sec, timeout_sec >= 2 ? "seconds" : "second");
|
|
||||||
this->setting_dialog->set_state_text(text_buf);
|
|
||||||
|
|
||||||
for (auto new_joystick_state = new_joystick_states.begin();new_joystick_state != new_joystick_states.end();new_joystick_state++)
|
|
||||||
{
|
{
|
||||||
auto last_joystick_state = this->last_joystick_states.find(new_joystick_state->first);
|
char text_buf[128];
|
||||||
if (last_joystick_state == this->last_joystick_states.end())
|
|
||||||
|
int timeout_sec = this->timeout_msec / 1000;
|
||||||
|
|
||||||
|
const std::map<uint32_t, joystick_state>& new_joystick_states = this->setting_dialog->get_joystick_states();
|
||||||
|
|
||||||
|
sprintf(text_buf, "Input %s for %s, timeout in %d %s", this->is_axis ? "axis" : "button/hat", this->name.c_str(), timeout_sec, timeout_sec >= 2 ? "seconds" : "second");
|
||||||
|
this->setting_dialog->set_state_text(text_buf);
|
||||||
|
|
||||||
|
for (auto new_joystick_state = new_joystick_states.begin(); new_joystick_state != new_joystick_states.end(); new_joystick_state++)
|
||||||
{
|
{
|
||||||
continue;
|
auto last_joystick_state = this->last_joystick_states.find(new_joystick_state->first);
|
||||||
|
if (last_joystick_state == this->last_joystick_states.end())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->is_axis)
|
||||||
|
{
|
||||||
|
const static int16_t axis_change_threshold = 0x7FFF / 5;
|
||||||
|
if (last_joystick_state->second.axes.size() != new_joystick_state->second.axes.size())
|
||||||
|
{
|
||||||
|
logitech_g27_cfg_log.error("during input state change diff, number of axes on %04x:%04x changed", new_joystick_state->first >> 16, new_joystick_state->first & 0xFFFF);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
for (std::vector<int16_t>::size_type i = 0; i < new_joystick_state->second.axes.size(); i++)
|
||||||
|
{
|
||||||
|
int32_t diff = std::abs(last_joystick_state->second.axes[i] - new_joystick_state->second.axes[i]);
|
||||||
|
if (diff > axis_change_threshold)
|
||||||
|
{
|
||||||
|
this->mapping_in_progress = false;
|
||||||
|
this->setting_dialog->set_state_text(DEFAULT_STATUS);
|
||||||
|
this->setting_dialog->enable();
|
||||||
|
this->mapping.device_type_id = new_joystick_state->first;
|
||||||
|
this->mapping.type = MAPPING_AXIS;
|
||||||
|
this->mapping.id = i;
|
||||||
|
this->mapping.hat = HAT_NONE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (last_joystick_state->second.buttons.size() != new_joystick_state->second.buttons.size())
|
||||||
|
{
|
||||||
|
logitech_g27_cfg_log.error("during input state change diff, number of buttons on %04x:%04x changed", new_joystick_state->first >> 16, new_joystick_state->first & 0xFFFF);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (last_joystick_state->second.hats.size() != new_joystick_state->second.hats.size())
|
||||||
|
{
|
||||||
|
logitech_g27_cfg_log.error("during input state change diff, number of hats on %04x:%04x changed", new_joystick_state->first >> 16, new_joystick_state->first & 0xFFFF);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
for (std::vector<int16_t>::size_type i = 0; i < new_joystick_state->second.buttons.size(); i++)
|
||||||
|
{
|
||||||
|
if (last_joystick_state->second.buttons[i] != new_joystick_state->second.buttons[i])
|
||||||
|
{
|
||||||
|
this->mapping_in_progress = false;
|
||||||
|
this->setting_dialog->set_state_text(DEFAULT_STATUS);
|
||||||
|
this->setting_dialog->enable();
|
||||||
|
this->mapping.device_type_id = new_joystick_state->first;
|
||||||
|
this->mapping.type = MAPPING_BUTTON;
|
||||||
|
this->mapping.id = i;
|
||||||
|
this->mapping.hat = HAT_NONE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (std::vector<int16_t>::size_type i = 0; i < new_joystick_state->second.hats.size(); i++)
|
||||||
|
{
|
||||||
|
if (last_joystick_state->second.hats[i] != new_joystick_state->second.hats[i] && new_joystick_state->second.hats[i] != HAT_NONE)
|
||||||
|
{
|
||||||
|
this->mapping_in_progress = false;
|
||||||
|
this->setting_dialog->set_state_text(DEFAULT_STATUS);
|
||||||
|
this->setting_dialog->enable();
|
||||||
|
this->mapping.device_type_id = new_joystick_state->first;
|
||||||
|
this->mapping.type = MAPPING_HAT;
|
||||||
|
this->mapping.id = i;
|
||||||
|
this->mapping.hat = new_joystick_state->second.hats[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->is_axis)
|
this->timeout_msec = this->timeout_msec - 25;
|
||||||
|
if (this->timeout_msec <= 0)
|
||||||
{
|
{
|
||||||
const static int16_t axis_change_threshold = 0x7FFF / 5;
|
this->mapping_in_progress = false;
|
||||||
if (last_joystick_state->second.axes.size() != new_joystick_state->second.axes.size())
|
this->setting_dialog->set_state_text(DEFAULT_STATUS);
|
||||||
{
|
this->setting_dialog->enable();
|
||||||
logitech_g27_cfg_log.error("during input state change diff, number of axes on %04x:%04x changed", new_joystick_state->first >> 16, new_joystick_state->first & 0xFFFF);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
for (std::vector<int16_t>::size_type i = 0;i < new_joystick_state->second.axes.size();i++)
|
|
||||||
{
|
|
||||||
int32_t diff = std::abs(last_joystick_state->second.axes[i] - new_joystick_state->second.axes[i]);
|
|
||||||
if (diff > axis_change_threshold)
|
|
||||||
{
|
|
||||||
this->mapping_in_progress = false;
|
|
||||||
this->setting_dialog->set_state_text(DEFAULT_STATUS);
|
|
||||||
this->setting_dialog->enable();
|
|
||||||
this->mapping.device_type_id = new_joystick_state->first;
|
|
||||||
this->mapping.type = MAPPING_AXIS;
|
|
||||||
this->mapping.id = i;
|
|
||||||
this->mapping.hat = HAT_NONE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (last_joystick_state->second.buttons.size() != new_joystick_state->second.buttons.size())
|
|
||||||
{
|
|
||||||
logitech_g27_cfg_log.error("during input state change diff, number of buttons on %04x:%04x changed", new_joystick_state->first >> 16, new_joystick_state->first & 0xFFFF);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (last_joystick_state->second.hats.size() != new_joystick_state->second.hats.size())
|
|
||||||
{
|
|
||||||
logitech_g27_cfg_log.error("during input state change diff, number of hats on %04x:%04x changed", new_joystick_state->first >> 16, new_joystick_state->first & 0xFFFF);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
for (std::vector<int16_t>::size_type i = 0;i < new_joystick_state->second.buttons.size();i++)
|
|
||||||
{
|
|
||||||
if (last_joystick_state->second.buttons[i] != new_joystick_state->second.buttons[i])
|
|
||||||
{
|
|
||||||
this->mapping_in_progress = false;
|
|
||||||
this->setting_dialog->set_state_text(DEFAULT_STATUS);
|
|
||||||
this->setting_dialog->enable();
|
|
||||||
this->mapping.device_type_id = new_joystick_state->first;
|
|
||||||
this->mapping.type = MAPPING_BUTTON;
|
|
||||||
this->mapping.id = i;
|
|
||||||
this->mapping.hat = HAT_NONE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (std::vector<int16_t>::size_type i = 0;i < new_joystick_state->second.hats.size();i++)
|
|
||||||
{
|
|
||||||
if (last_joystick_state->second.hats[i] != new_joystick_state->second.hats[i] && new_joystick_state->second.hats[i] != HAT_NONE)
|
|
||||||
{
|
|
||||||
this->mapping_in_progress = false;
|
|
||||||
this->setting_dialog->set_state_text(DEFAULT_STATUS);
|
|
||||||
this->setting_dialog->enable();
|
|
||||||
this->mapping.device_type_id = new_joystick_state->first;
|
|
||||||
this->mapping.type = MAPPING_HAT;
|
|
||||||
this->mapping.id = i;
|
|
||||||
this->mapping.hat = new_joystick_state->second.hats[i];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this->timeout_msec = this->timeout_msec - 25;
|
update_display();
|
||||||
if (this->timeout_msec <= 0)
|
});
|
||||||
{
|
|
||||||
this->mapping_in_progress = false;
|
|
||||||
this->setting_dialog->set_state_text(DEFAULT_STATUS);
|
|
||||||
this->setting_dialog->enable();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
update_display();
|
|
||||||
});
|
|
||||||
tick_timer->start(25);
|
tick_timer->start(25);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,13 +295,13 @@ public:
|
||||||
reverse_checkbox->setEnabled(true);
|
reverse_checkbox->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_mapping(const sdl_mapping &mapping)
|
void set_mapping(const sdl_mapping& mapping)
|
||||||
{
|
{
|
||||||
this->mapping = mapping;
|
this->mapping = mapping;
|
||||||
update_display();
|
update_display();
|
||||||
}
|
}
|
||||||
|
|
||||||
const sdl_mapping &get_mapping()
|
const sdl_mapping& get_mapping()
|
||||||
{
|
{
|
||||||
return mapping;
|
return mapping;
|
||||||
}
|
}
|
||||||
|
@ -306,59 +311,60 @@ private:
|
||||||
bool is_axis;
|
bool is_axis;
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
||||||
DeviceChoice *ffb_device;
|
DeviceChoice* ffb_device;
|
||||||
DeviceChoice *led_device;
|
DeviceChoice* led_device;
|
||||||
QLabel *display_box;
|
QLabel* display_box;
|
||||||
QPushButton *ffb_set_button;
|
QPushButton* ffb_set_button;
|
||||||
QPushButton *led_set_button;
|
QPushButton* led_set_button;
|
||||||
QPushButton *map_button;
|
QPushButton* map_button;
|
||||||
QPushButton *unmap_button;
|
QPushButton* unmap_button;
|
||||||
QCheckBox *reverse_checkbox;
|
QCheckBox* reverse_checkbox;
|
||||||
|
|
||||||
bool mapping_in_progress;
|
bool mapping_in_progress;
|
||||||
int timeout_msec = 5000;
|
int timeout_msec = 5000;
|
||||||
QTimer *tick_timer;
|
QTimer* tick_timer;
|
||||||
std::map<uint32_t, joystick_state> last_joystick_states;
|
std::map<uint32_t, joystick_state> last_joystick_states;
|
||||||
|
|
||||||
QCheckBox *button_status;
|
QCheckBox* button_status;
|
||||||
QSlider *axis_status;
|
QSlider* axis_status;
|
||||||
bool flip_axis_display;
|
bool flip_axis_display;
|
||||||
|
|
||||||
emulated_logitech_g27_settings_dialog *setting_dialog;
|
emulated_logitech_g27_settings_dialog* setting_dialog;
|
||||||
|
|
||||||
void update_display(){
|
void update_display()
|
||||||
|
{
|
||||||
char text_buf[64];
|
char text_buf[64];
|
||||||
const char *type_string = nullptr;
|
const char* type_string = nullptr;
|
||||||
switch(mapping.type)
|
switch (mapping.type)
|
||||||
{
|
{
|
||||||
case MAPPING_BUTTON:
|
case MAPPING_BUTTON:
|
||||||
type_string = "button";
|
type_string = "button";
|
||||||
break;
|
break;
|
||||||
case MAPPING_HAT:
|
case MAPPING_HAT:
|
||||||
type_string = "hat";
|
type_string = "hat";
|
||||||
break;
|
break;
|
||||||
case MAPPING_AXIS:
|
case MAPPING_AXIS:
|
||||||
type_string = "axis";
|
type_string = "axis";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
const char *hat_string = nullptr;
|
const char* hat_string = nullptr;
|
||||||
switch(mapping.hat)
|
switch (mapping.hat)
|
||||||
{
|
{
|
||||||
case HAT_UP:
|
case HAT_UP:
|
||||||
hat_string = "up";
|
hat_string = "up";
|
||||||
break;
|
break;
|
||||||
case HAT_DOWN:
|
case HAT_DOWN:
|
||||||
hat_string = "down";
|
hat_string = "down";
|
||||||
break;
|
break;
|
||||||
case HAT_LEFT:
|
case HAT_LEFT:
|
||||||
hat_string = "left";
|
hat_string = "left";
|
||||||
break;
|
break;
|
||||||
case HAT_RIGHT:
|
case HAT_RIGHT:
|
||||||
hat_string = "right";
|
hat_string = "right";
|
||||||
break;
|
break;
|
||||||
case HAT_NONE:
|
case HAT_NONE:
|
||||||
hat_string = "";
|
hat_string = "";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sprintf(text_buf, "%04x:%04x, %s %u %s", mapping.device_type_id >> 16, mapping.device_type_id & 0xFFFF, type_string, mapping.id, hat_string);
|
sprintf(text_buf, "%04x:%04x, %s %u %s", mapping.device_type_id >> 16, mapping.device_type_id & 0xFFFF, type_string, mapping.id, hat_string);
|
||||||
display_box->setText(QString(text_buf));
|
display_box->setText(QString(text_buf));
|
||||||
|
@ -382,49 +388,49 @@ private:
|
||||||
axis_status->setValue(axis_value);
|
axis_status->setValue(axis_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::map<uint32_t, joystick_state> &joystick_states = setting_dialog->get_joystick_states();
|
const std::map<uint32_t, joystick_state>& joystick_states = setting_dialog->get_joystick_states();
|
||||||
auto joystick_state = joystick_states.find(mapping.device_type_id);
|
auto joystick_state = joystick_states.find(mapping.device_type_id);
|
||||||
|
|
||||||
if (joystick_state != joystick_states.end())
|
if (joystick_state != joystick_states.end())
|
||||||
{
|
{
|
||||||
switch(mapping.type)
|
switch (mapping.type)
|
||||||
{
|
{
|
||||||
case MAPPING_BUTTON:
|
case MAPPING_BUTTON:
|
||||||
{
|
{
|
||||||
if (joystick_state->second.buttons.size() <= mapping.id)
|
if (joystick_state->second.buttons.size() <= mapping.id)
|
||||||
break;
|
|
||||||
bool value = joystick_state->second.buttons[mapping.id];
|
|
||||||
if (mapping.reverse)
|
|
||||||
value = !value;
|
|
||||||
button_status->setChecked(value);
|
|
||||||
break;
|
break;
|
||||||
}
|
bool value = joystick_state->second.buttons[mapping.id];
|
||||||
case MAPPING_HAT:
|
if (mapping.reverse)
|
||||||
{
|
value = !value;
|
||||||
if (joystick_state->second.hats.size() <= mapping.id)
|
button_status->setChecked(value);
|
||||||
break;
|
break;
|
||||||
bool value = joystick_state->second.hats[mapping.id] == mapping.hat;
|
}
|
||||||
if (mapping.reverse)
|
case MAPPING_HAT:
|
||||||
value = !value;
|
{
|
||||||
button_status->setChecked(value);
|
if (joystick_state->second.hats.size() <= mapping.id)
|
||||||
break;
|
break;
|
||||||
}
|
bool value = joystick_state->second.hats[mapping.id] == mapping.hat;
|
||||||
case MAPPING_AXIS:
|
if (mapping.reverse)
|
||||||
{
|
value = !value;
|
||||||
if (joystick_state->second.axes.size() <= mapping.id)
|
button_status->setChecked(value);
|
||||||
break;
|
break;
|
||||||
int32_t value = joystick_state->second.axes[mapping.id];
|
}
|
||||||
if (mapping.reverse)
|
case MAPPING_AXIS:
|
||||||
value = value * (-1);
|
{
|
||||||
if (flip_axis_display)
|
if (joystick_state->second.axes.size() <= mapping.id)
|
||||||
value = value * (-1);
|
|
||||||
if (value > 0x7FFF)
|
|
||||||
value = 0x7FFF;
|
|
||||||
else if (value < (-0x8000))
|
|
||||||
value = (-0x8000);
|
|
||||||
axis_status->setValue(value);
|
|
||||||
break;
|
break;
|
||||||
}
|
int32_t value = joystick_state->second.axes[mapping.id];
|
||||||
|
if (mapping.reverse)
|
||||||
|
value = value * (-1);
|
||||||
|
if (flip_axis_display)
|
||||||
|
value = value * (-1);
|
||||||
|
if (value > 0x7FFF)
|
||||||
|
value = 0x7FFF;
|
||||||
|
else if (value < (-0x8000))
|
||||||
|
value = (-0x8000);
|
||||||
|
axis_status->setValue(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -432,14 +438,14 @@ private:
|
||||||
|
|
||||||
void emulated_logitech_g27_settings_dialog::save_ui_state_to_config()
|
void emulated_logitech_g27_settings_dialog::save_ui_state_to_config()
|
||||||
{
|
{
|
||||||
#define SAVE_MAPPING(name) \
|
#define SAVE_MAPPING(name) \
|
||||||
{ \
|
{ \
|
||||||
const sdl_mapping &m = name->get_mapping(); \
|
const sdl_mapping& m = name->get_mapping(); \
|
||||||
g_cfg_logitech_g27.name##_device_type_id.set(m.device_type_id); \
|
g_cfg_logitech_g27.name##_device_type_id.set(m.device_type_id); \
|
||||||
g_cfg_logitech_g27.name##_type.set(m.type); \
|
g_cfg_logitech_g27.name##_type.set(m.type); \
|
||||||
g_cfg_logitech_g27.name##_id.set(m.id); \
|
g_cfg_logitech_g27.name##_id.set(m.id); \
|
||||||
g_cfg_logitech_g27.name##_hat.set(m.hat); \
|
g_cfg_logitech_g27.name##_hat.set(m.hat); \
|
||||||
g_cfg_logitech_g27.name##_reverse.set(m.reverse); \
|
g_cfg_logitech_g27.name##_reverse.set(m.reverse); \
|
||||||
}
|
}
|
||||||
|
|
||||||
SAVE_MAPPING(steering);
|
SAVE_MAPPING(steering);
|
||||||
|
@ -481,7 +487,7 @@ void emulated_logitech_g27_settings_dialog::save_ui_state_to_config()
|
||||||
SAVE_MAPPING(shifter_6);
|
SAVE_MAPPING(shifter_6);
|
||||||
SAVE_MAPPING(shifter_r);
|
SAVE_MAPPING(shifter_r);
|
||||||
|
|
||||||
#undef SAVE_MAPPING
|
#undef SAVE_MAPPING
|
||||||
|
|
||||||
g_cfg_logitech_g27.ffb_device_type_id.set(ffb_device->get_device_type_id());
|
g_cfg_logitech_g27.ffb_device_type_id.set(ffb_device->get_device_type_id());
|
||||||
g_cfg_logitech_g27.led_device_type_id.set(led_device->get_device_type_id());
|
g_cfg_logitech_g27.led_device_type_id.set(led_device->get_device_type_id());
|
||||||
|
@ -492,17 +498,16 @@ void emulated_logitech_g27_settings_dialog::save_ui_state_to_config()
|
||||||
|
|
||||||
void emulated_logitech_g27_settings_dialog::load_ui_state_from_config()
|
void emulated_logitech_g27_settings_dialog::load_ui_state_from_config()
|
||||||
{
|
{
|
||||||
#define LOAD_MAPPING(name) \
|
#define LOAD_MAPPING(name) \
|
||||||
{ \
|
{ \
|
||||||
sdl_mapping m = { \
|
sdl_mapping m = { \
|
||||||
.device_type_id = static_cast<uint32_t>(g_cfg_logitech_g27.name##_device_type_id.get()), \
|
.device_type_id = static_cast<uint32_t>(g_cfg_logitech_g27.name##_device_type_id.get()), \
|
||||||
.type = static_cast<sdl_mapping_type>(g_cfg_logitech_g27.name##_type.get()), \
|
.type = static_cast<sdl_mapping_type>(g_cfg_logitech_g27.name##_type.get()), \
|
||||||
.id = static_cast<uint8_t>(g_cfg_logitech_g27.name##_id.get()), \
|
.id = static_cast<uint8_t>(g_cfg_logitech_g27.name##_id.get()), \
|
||||||
.hat = static_cast<hat_component>(g_cfg_logitech_g27.name##_hat.get()), \
|
.hat = static_cast<hat_component>(g_cfg_logitech_g27.name##_hat.get()), \
|
||||||
.reverse = g_cfg_logitech_g27.name##_reverse.get(), \
|
.reverse = g_cfg_logitech_g27.name##_reverse.get(), \
|
||||||
.positive_axis = false \
|
.positive_axis = false}; \
|
||||||
}; \
|
name->set_mapping(m); \
|
||||||
name->set_mapping(m); \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LOAD_MAPPING(steering);
|
LOAD_MAPPING(steering);
|
||||||
|
@ -544,7 +549,7 @@ void emulated_logitech_g27_settings_dialog::load_ui_state_from_config()
|
||||||
LOAD_MAPPING(shifter_6);
|
LOAD_MAPPING(shifter_6);
|
||||||
LOAD_MAPPING(shifter_r);
|
LOAD_MAPPING(shifter_r);
|
||||||
|
|
||||||
#undef LOAD_MAPPING
|
#undef LOAD_MAPPING
|
||||||
|
|
||||||
ffb_device->set_device_type_id(static_cast<uint32_t>(g_cfg_logitech_g27.ffb_device_type_id.get()));
|
ffb_device->set_device_type_id(static_cast<uint32_t>(g_cfg_logitech_g27.ffb_device_type_id.get()));
|
||||||
led_device->set_device_type_id(static_cast<uint32_t>(g_cfg_logitech_g27.led_device_type_id.get()));
|
led_device->set_device_type_id(static_cast<uint32_t>(g_cfg_logitech_g27.led_device_type_id.get()));
|
||||||
|
@ -570,34 +575,34 @@ emulated_logitech_g27_settings_dialog::emulated_logitech_g27_settings_dialog(QWi
|
||||||
g_cfg_logitech_g27.load();
|
g_cfg_logitech_g27.load();
|
||||||
|
|
||||||
connect(buttons, &QDialogButtonBox::clicked, this, [this, buttons](QAbstractButton* button)
|
connect(buttons, &QDialogButtonBox::clicked, this, [this, buttons](QAbstractButton* button)
|
||||||
{
|
|
||||||
if (button == buttons->button(QDialogButtonBox::Apply))
|
|
||||||
{
|
{
|
||||||
save_ui_state_to_config();
|
if (button == buttons->button(QDialogButtonBox::Apply))
|
||||||
g_cfg_logitech_g27.save();
|
{
|
||||||
load_ui_state_from_config();
|
save_ui_state_to_config();
|
||||||
}
|
g_cfg_logitech_g27.save();
|
||||||
else if (button == buttons->button(QDialogButtonBox::Save))
|
load_ui_state_from_config();
|
||||||
{
|
}
|
||||||
save_ui_state_to_config();
|
else if (button == buttons->button(QDialogButtonBox::Save))
|
||||||
g_cfg_logitech_g27.save();
|
{
|
||||||
accept();
|
save_ui_state_to_config();
|
||||||
}
|
g_cfg_logitech_g27.save();
|
||||||
else if (button == buttons->button(QDialogButtonBox::RestoreDefaults))
|
accept();
|
||||||
{
|
}
|
||||||
if (QMessageBox::question(this, tr("Confirm Reset"), tr("Reset all?")) != QMessageBox::Yes)
|
else if (button == buttons->button(QDialogButtonBox::RestoreDefaults))
|
||||||
return;
|
{
|
||||||
g_cfg_logitech_g27.fill_defaults();
|
if (QMessageBox::question(this, tr("Confirm Reset"), tr("Reset all?")) != QMessageBox::Yes)
|
||||||
load_ui_state_from_config();
|
return;
|
||||||
g_cfg_logitech_g27.save();
|
g_cfg_logitech_g27.fill_defaults();
|
||||||
}
|
load_ui_state_from_config();
|
||||||
else if (button == buttons->button(QDialogButtonBox::Cancel))
|
g_cfg_logitech_g27.save();
|
||||||
{
|
}
|
||||||
reject();
|
else if (button == buttons->button(QDialogButtonBox::Cancel))
|
||||||
}
|
{
|
||||||
});
|
reject();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
QLabel *warning = new QLabel(QString("Warning: Force feedback output were meant for Logitech G27, on stronger wheels please adjust force strength accordingly in your wheel software."), this);
|
QLabel* warning = new QLabel(QString("Warning: Force feedback output were meant for Logitech G27, on stronger wheels please adjust force strength accordingly in your wheel software."), this);
|
||||||
warning->setStyleSheet("color: red;");
|
warning->setStyleSheet("color: red;");
|
||||||
v_layout->addWidget(warning);
|
v_layout->addWidget(warning);
|
||||||
|
|
||||||
|
@ -616,7 +621,7 @@ emulated_logitech_g27_settings_dialog::emulated_logitech_g27_settings_dialog(QWi
|
||||||
led_device = new DeviceChoice(this, g_cfg_logitech_g27.led_device_type_id.get(), "LED Device");
|
led_device = new DeviceChoice(this, g_cfg_logitech_g27.led_device_type_id.get(), "LED Device");
|
||||||
|
|
||||||
mapping_scroll_area = new QScrollArea(this);
|
mapping_scroll_area = new QScrollArea(this);
|
||||||
QWidget *mapping_widget = new QWidget(mapping_scroll_area);
|
QWidget* mapping_widget = new QWidget(mapping_scroll_area);
|
||||||
QVBoxLayout* mapping_layout = new QVBoxLayout(mapping_widget);
|
QVBoxLayout* mapping_layout = new QVBoxLayout(mapping_widget);
|
||||||
mapping_widget->setLayout(mapping_layout);
|
mapping_widget->setLayout(mapping_layout);
|
||||||
mapping_scroll_area->setWidget(mapping_widget);
|
mapping_scroll_area->setWidget(mapping_widget);
|
||||||
|
@ -627,21 +632,20 @@ emulated_logitech_g27_settings_dialog::emulated_logitech_g27_settings_dialog(QWi
|
||||||
|
|
||||||
v_layout->addWidget(mapping_scroll_area);
|
v_layout->addWidget(mapping_scroll_area);
|
||||||
|
|
||||||
#define ADD_MAPPING_SETTING(name, is_axis, display_name, flip_axis_display) \
|
#define ADD_MAPPING_SETTING(name, is_axis, display_name, flip_axis_display) \
|
||||||
{ \
|
{ \
|
||||||
sdl_mapping m = { \
|
sdl_mapping m = { \
|
||||||
.device_type_id = static_cast<uint32_t>(g_cfg_logitech_g27.name##_device_type_id.get()), \
|
.device_type_id = static_cast<uint32_t>(g_cfg_logitech_g27.name##_device_type_id.get()), \
|
||||||
.type = static_cast<sdl_mapping_type>(g_cfg_logitech_g27.name##_type.get()), \
|
.type = static_cast<sdl_mapping_type>(g_cfg_logitech_g27.name##_type.get()), \
|
||||||
.id = static_cast<uint8_t>(g_cfg_logitech_g27.name##_id.get()), \
|
.id = static_cast<uint8_t>(g_cfg_logitech_g27.name##_id.get()), \
|
||||||
.hat = static_cast<hat_component>(g_cfg_logitech_g27.name##_hat.get()), \
|
.hat = static_cast<hat_component>(g_cfg_logitech_g27.name##_hat.get()), \
|
||||||
.reverse = g_cfg_logitech_g27.name##_reverse.get(), \
|
.reverse = g_cfg_logitech_g27.name##_reverse.get(), \
|
||||||
.positive_axis = false \
|
.positive_axis = false}; \
|
||||||
}; \
|
|
||||||
name = new Mapping(mapping_widget, this, ffb_device, led_device, m, is_axis, display_name, flip_axis_display); \
|
name = new Mapping(mapping_widget, this, ffb_device, led_device, m, is_axis, display_name, flip_axis_display); \
|
||||||
mapping_layout->addWidget(name); \
|
mapping_layout->addWidget(name); \
|
||||||
}
|
}
|
||||||
|
|
||||||
QLabel *axis_label = new QLabel(QString("Axes:"), mapping_widget);
|
QLabel* axis_label = new QLabel(QString("Axes:"), mapping_widget);
|
||||||
mapping_layout->addWidget(axis_label);
|
mapping_layout->addWidget(axis_label);
|
||||||
|
|
||||||
ADD_MAPPING_SETTING(steering, true, "Steering", false);
|
ADD_MAPPING_SETTING(steering, true, "Steering", false);
|
||||||
|
@ -649,7 +653,7 @@ emulated_logitech_g27_settings_dialog::emulated_logitech_g27_settings_dialog(QWi
|
||||||
ADD_MAPPING_SETTING(brake, true, "Brake", true);
|
ADD_MAPPING_SETTING(brake, true, "Brake", true);
|
||||||
ADD_MAPPING_SETTING(clutch, true, "Clutch", true);
|
ADD_MAPPING_SETTING(clutch, true, "Clutch", true);
|
||||||
|
|
||||||
QLabel *button_label = new QLabel(QString("Buttons:"), mapping_widget);
|
QLabel* button_label = new QLabel(QString("Buttons:"), mapping_widget);
|
||||||
mapping_layout->addWidget(button_label);
|
mapping_layout->addWidget(button_label);
|
||||||
|
|
||||||
ADD_MAPPING_SETTING(shift_up, false, "Shift up", false);
|
ADD_MAPPING_SETTING(shift_up, false, "Shift up", false);
|
||||||
|
@ -687,7 +691,7 @@ emulated_logitech_g27_settings_dialog::emulated_logitech_g27_settings_dialog(QWi
|
||||||
ADD_MAPPING_SETTING(shifter_6, false, "Gear 6", false);
|
ADD_MAPPING_SETTING(shifter_6, false, "Gear 6", false);
|
||||||
ADD_MAPPING_SETTING(shifter_r, false, "Gear R", false);
|
ADD_MAPPING_SETTING(shifter_r, false, "Gear R", false);
|
||||||
|
|
||||||
#undef ADD_MAPPING_SETTING
|
#undef ADD_MAPPING_SETTING
|
||||||
|
|
||||||
v_layout->addWidget(ffb_device);
|
v_layout->addWidget(ffb_device);
|
||||||
v_layout->addWidget(led_device);
|
v_layout->addWidget(led_device);
|
||||||
|
@ -703,7 +707,7 @@ emulated_logitech_g27_settings_dialog::emulated_logitech_g27_settings_dialog(QWi
|
||||||
|
|
||||||
emulated_logitech_g27_settings_dialog::~emulated_logitech_g27_settings_dialog()
|
emulated_logitech_g27_settings_dialog::~emulated_logitech_g27_settings_dialog()
|
||||||
{
|
{
|
||||||
for (auto joystick_handle = joystick_handles.begin();joystick_handle != joystick_handles.end();joystick_handle++)
|
for (auto joystick_handle = joystick_handles.begin(); joystick_handle != joystick_handles.end(); joystick_handle++)
|
||||||
{
|
{
|
||||||
SDL_CloseJoystick(*joystick_handle);
|
SDL_CloseJoystick(*joystick_handle);
|
||||||
}
|
}
|
||||||
|
@ -734,7 +738,7 @@ static inline hat_component get_sdl_hat_component(uint8_t sdl_hat)
|
||||||
return HAT_NONE;
|
return HAT_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::map<uint32_t, joystick_state> &emulated_logitech_g27_settings_dialog::get_joystick_states()
|
const std::map<uint32_t, joystick_state>& emulated_logitech_g27_settings_dialog::get_joystick_states()
|
||||||
{
|
{
|
||||||
if (!sdl_initialized)
|
if (!sdl_initialized)
|
||||||
{
|
{
|
||||||
|
@ -755,15 +759,15 @@ const std::map<uint32_t, joystick_state> &emulated_logitech_g27_settings_dialog:
|
||||||
sdl_instance::get_instance().pump_events();
|
sdl_instance::get_instance().pump_events();
|
||||||
|
|
||||||
int joystick_count;
|
int joystick_count;
|
||||||
SDL_JoystickID *joystick_ids = SDL_GetJoysticks(&joystick_count);
|
SDL_JoystickID* joystick_ids = SDL_GetJoysticks(&joystick_count);
|
||||||
|
|
||||||
std::vector<SDL_Joystick *> new_joystick_handles;
|
std::vector<SDL_Joystick*> new_joystick_handles;
|
||||||
|
|
||||||
if (joystick_ids != nullptr)
|
if (joystick_ids != nullptr)
|
||||||
{
|
{
|
||||||
for (int i = 0;i < joystick_count;i++)
|
for (int i = 0; i < joystick_count; i++)
|
||||||
{
|
{
|
||||||
SDL_Joystick *cur_joystick = SDL_OpenJoystick(joystick_ids[i]);
|
SDL_Joystick* cur_joystick = SDL_OpenJoystick(joystick_ids[i]);
|
||||||
if (cur_joystick == nullptr)
|
if (cur_joystick == nullptr)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
@ -779,15 +783,15 @@ const std::map<uint32_t, joystick_state> &emulated_logitech_g27_settings_dialog:
|
||||||
int num_axes = SDL_GetNumJoystickAxes(cur_joystick);
|
int num_axes = SDL_GetNumJoystickAxes(cur_joystick);
|
||||||
int num_buttons = SDL_GetNumJoystickButtons(cur_joystick);
|
int num_buttons = SDL_GetNumJoystickButtons(cur_joystick);
|
||||||
int num_hats = SDL_GetNumJoystickHats(cur_joystick);
|
int num_hats = SDL_GetNumJoystickHats(cur_joystick);
|
||||||
for (int j = 0;j < num_axes;j++)
|
for (int j = 0; j < num_axes; j++)
|
||||||
{
|
{
|
||||||
s.axes.push_back(SDL_GetJoystickAxis(cur_joystick, j));
|
s.axes.push_back(SDL_GetJoystickAxis(cur_joystick, j));
|
||||||
}
|
}
|
||||||
for (int j = 0;j < num_buttons;j++)
|
for (int j = 0; j < num_buttons; j++)
|
||||||
{
|
{
|
||||||
s.buttons.push_back(SDL_GetJoystickButton(cur_joystick, j));
|
s.buttons.push_back(SDL_GetJoystickButton(cur_joystick, j));
|
||||||
}
|
}
|
||||||
for (int j = 0;j < num_hats;j++)
|
for (int j = 0; j < num_hats; j++)
|
||||||
{
|
{
|
||||||
uint8_t sdl_hat = SDL_GetJoystickHat(cur_joystick, j);
|
uint8_t sdl_hat = SDL_GetJoystickHat(cur_joystick, j);
|
||||||
s.hats.push_back(get_sdl_hat_component(sdl_hat));
|
s.hats.push_back(get_sdl_hat_component(sdl_hat));
|
||||||
|
@ -796,15 +800,15 @@ const std::map<uint32_t, joystick_state> &emulated_logitech_g27_settings_dialog:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (std::vector<int16_t>::size_type j = 0;j < cur_state->second.axes.size();j++)
|
for (std::vector<int16_t>::size_type j = 0; j < cur_state->second.axes.size(); j++)
|
||||||
{
|
{
|
||||||
cur_state->second.axes[j] = (cur_state->second.axes[j] + SDL_GetJoystickAxis(cur_joystick, j)) / 2;
|
cur_state->second.axes[j] = (cur_state->second.axes[j] + SDL_GetJoystickAxis(cur_joystick, j)) / 2;
|
||||||
}
|
}
|
||||||
for (std::vector<bool>::size_type j = 0;j < cur_state->second.buttons.size();j++)
|
for (std::vector<bool>::size_type j = 0; j < cur_state->second.buttons.size(); j++)
|
||||||
{
|
{
|
||||||
cur_state->second.buttons[j] = cur_state->second.buttons[j] || SDL_GetJoystickButton(cur_joystick, j);
|
cur_state->second.buttons[j] = cur_state->second.buttons[j] || SDL_GetJoystickButton(cur_joystick, j);
|
||||||
}
|
}
|
||||||
for (std::vector<hat_component>::size_type j = 0;j < cur_state->second.hats.size();j++)
|
for (std::vector<hat_component>::size_type j = 0; j < cur_state->second.hats.size(); j++)
|
||||||
{
|
{
|
||||||
if (cur_state->second.hats[j] != HAT_NONE)
|
if (cur_state->second.hats[j] != HAT_NONE)
|
||||||
continue;
|
continue;
|
||||||
|
@ -815,7 +819,7 @@ const std::map<uint32_t, joystick_state> &emulated_logitech_g27_settings_dialog:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto joystick_handle = joystick_handles.begin(); joystick_handle != joystick_handles.end();joystick_handle++)
|
for (auto joystick_handle = joystick_handles.begin(); joystick_handle != joystick_handles.end(); joystick_handle++)
|
||||||
{
|
{
|
||||||
SDL_CloseJoystick(*joystick_handle);
|
SDL_CloseJoystick(*joystick_handle);
|
||||||
}
|
}
|
||||||
|
@ -826,7 +830,7 @@ const std::map<uint32_t, joystick_state> &emulated_logitech_g27_settings_dialog:
|
||||||
return last_joystick_states;
|
return last_joystick_states;
|
||||||
}
|
}
|
||||||
|
|
||||||
void emulated_logitech_g27_settings_dialog::set_state_text(const char *text)
|
void emulated_logitech_g27_settings_dialog::set_state_text(const char* text)
|
||||||
{
|
{
|
||||||
state_text->setText(QString(text));
|
state_text->setText(QString(text));
|
||||||
}
|
}
|
||||||
|
@ -836,11 +840,11 @@ void emulated_logitech_g27_settings_dialog::toggle_state(bool enable)
|
||||||
|
|
||||||
int slider_position = mapping_scroll_area->verticalScrollBar()->sliderPosition();
|
int slider_position = mapping_scroll_area->verticalScrollBar()->sliderPosition();
|
||||||
|
|
||||||
#define TOGGLE_STATE(name) \
|
#define TOGGLE_STATE(name) \
|
||||||
{ \
|
{ \
|
||||||
if (enable) \
|
if (enable) \
|
||||||
name->enable(); \
|
name->enable(); \
|
||||||
else \
|
else \
|
||||||
name->disable(); \
|
name->disable(); \
|
||||||
}
|
}
|
||||||
TOGGLE_STATE(steering);
|
TOGGLE_STATE(steering);
|
||||||
|
@ -882,7 +886,7 @@ void emulated_logitech_g27_settings_dialog::toggle_state(bool enable)
|
||||||
TOGGLE_STATE(shifter_6);
|
TOGGLE_STATE(shifter_6);
|
||||||
TOGGLE_STATE(shifter_r);
|
TOGGLE_STATE(shifter_r);
|
||||||
|
|
||||||
#undef TOGGLE_STATE
|
#undef TOGGLE_STATE
|
||||||
|
|
||||||
enabled->setEnabled(enable);
|
enabled->setEnabled(enable);
|
||||||
reverse_effects->setEnabled(enable);
|
reverse_effects->setEnabled(enable);
|
||||||
|
@ -891,11 +895,13 @@ void emulated_logitech_g27_settings_dialog::toggle_state(bool enable)
|
||||||
mapping_scroll_area->verticalScrollBar()->setSliderPosition(slider_position);
|
mapping_scroll_area->verticalScrollBar()->setSliderPosition(slider_position);
|
||||||
}
|
}
|
||||||
|
|
||||||
void emulated_logitech_g27_settings_dialog::enable(){
|
void emulated_logitech_g27_settings_dialog::enable()
|
||||||
|
{
|
||||||
toggle_state(true);
|
toggle_state(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void emulated_logitech_g27_settings_dialog::disable(){
|
void emulated_logitech_g27_settings_dialog::disable()
|
||||||
|
{
|
||||||
toggle_state(false);
|
toggle_state(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,65 +30,66 @@ public:
|
||||||
~emulated_logitech_g27_settings_dialog();
|
~emulated_logitech_g27_settings_dialog();
|
||||||
void disable();
|
void disable();
|
||||||
void enable();
|
void enable();
|
||||||
void set_state_text(const char *);
|
void set_state_text(const char*);
|
||||||
const std::map<uint32_t, joystick_state> &get_joystick_states();
|
const std::map<uint32_t, joystick_state>& get_joystick_states();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void toggle_state(bool enable);
|
void toggle_state(bool enable);
|
||||||
void load_ui_state_from_config();
|
void load_ui_state_from_config();
|
||||||
void save_ui_state_to_config();
|
void save_ui_state_to_config();
|
||||||
|
|
||||||
std::map<uint32_t, joystick_state> last_joystick_states;
|
std::map<uint32_t, joystick_state> last_joystick_states;
|
||||||
std::vector<SDL_Joystick *> joystick_handles;
|
std::vector<SDL_Joystick*> joystick_handles;
|
||||||
uint64_t last_joystick_states_update = 0;
|
uint64_t last_joystick_states_update = 0;
|
||||||
bool sdl_initialized = false;
|
bool sdl_initialized = false;
|
||||||
|
|
||||||
// ui elements
|
// ui elements
|
||||||
QLabel *state_text;
|
QLabel* state_text;
|
||||||
|
|
||||||
QCheckBox *enabled;
|
QCheckBox* enabled;
|
||||||
QCheckBox *reverse_effects;
|
QCheckBox* reverse_effects;
|
||||||
|
|
||||||
Mapping *steering;
|
Mapping* steering;
|
||||||
Mapping *throttle;
|
Mapping* throttle;
|
||||||
Mapping *brake;
|
Mapping* brake;
|
||||||
Mapping *clutch;
|
Mapping* clutch;
|
||||||
Mapping *shift_up;
|
Mapping* shift_up;
|
||||||
Mapping *shift_down;
|
Mapping* shift_down;
|
||||||
|
|
||||||
Mapping *up;
|
Mapping* up;
|
||||||
Mapping *down;
|
Mapping* down;
|
||||||
Mapping *left;
|
Mapping* left;
|
||||||
Mapping *right;
|
Mapping* right;
|
||||||
|
|
||||||
Mapping *triangle;
|
Mapping* triangle;
|
||||||
Mapping *cross;
|
Mapping* cross;
|
||||||
Mapping *square;
|
Mapping* square;
|
||||||
Mapping *circle;
|
Mapping* circle;
|
||||||
|
|
||||||
Mapping *l2;
|
Mapping* l2;
|
||||||
Mapping *l3;
|
Mapping* l3;
|
||||||
Mapping *r2;
|
Mapping* r2;
|
||||||
Mapping *r3;
|
Mapping* r3;
|
||||||
|
|
||||||
Mapping *plus;
|
Mapping* plus;
|
||||||
Mapping *minus;
|
Mapping* minus;
|
||||||
|
|
||||||
Mapping *dial_clockwise;
|
Mapping* dial_clockwise;
|
||||||
Mapping *dial_anticlockwise;
|
Mapping* dial_anticlockwise;
|
||||||
|
|
||||||
Mapping *select;
|
Mapping* select;
|
||||||
Mapping *pause;
|
Mapping* pause;
|
||||||
|
|
||||||
Mapping *shifter_1;
|
Mapping* shifter_1;
|
||||||
Mapping *shifter_2;
|
Mapping* shifter_2;
|
||||||
Mapping *shifter_3;
|
Mapping* shifter_3;
|
||||||
Mapping *shifter_4;
|
Mapping* shifter_4;
|
||||||
Mapping *shifter_5;
|
Mapping* shifter_5;
|
||||||
Mapping *shifter_6;
|
Mapping* shifter_6;
|
||||||
Mapping *shifter_r;
|
Mapping* shifter_r;
|
||||||
|
|
||||||
DeviceChoice *ffb_device;
|
DeviceChoice* ffb_device;
|
||||||
DeviceChoice *led_device;
|
DeviceChoice* led_device;
|
||||||
|
|
||||||
QScrollArea *mapping_scroll_area;
|
QScrollArea* mapping_scroll_area;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue