[GTK3] Disable rumble for the WUP-028 for now

This commit is contained in:
Maximilian Mader 2020-05-04 02:04:28 +02:00
parent b6c949fa82
commit 008db16fb5
Signed by: Max
GPG Key ID: F71D56A3151C4FB3
2 changed files with 14 additions and 1 deletions

View File

@ -124,6 +124,7 @@ typedef struct GuiData {
struct Controller_t {
SDL_GameController *controller;
SDL_Haptic *haptic;
bool ignore_rumble;
} *controllers;
unsigned controller_count;
struct Controller_t *last_used_controller; // Used for rumble
@ -508,6 +509,13 @@ static gboolean init_controllers(void) {
}
}
// Blacklist the WUP-028 for now
if (SDL_JoystickGetVendor(joystick) == 0x057e
&& SDL_JoystickGetProduct(joystick) == 0x0337
&& SDL_JoystickGetProductVersion(joystick) == 0x0100) {
s->ignore_rumble = true;
}
char guid_str[33];
SDL_JoystickGUID guid = SDL_JoystickGetGUID(joystick);
SDL_JoystickGetGUIDString(guid, guid_str, sizeof(guid_str));
@ -596,6 +604,8 @@ static void rumble_callback(GB_gameboy_t *gb, double amp) {
struct Controller_t *s = gui_data.last_used_controller;
if (s->ignore_rumble) return;
if (s->haptic) {
if (amp > 0.0) {
SDL_HapticRumblePlay(s->haptic, amp, 100.0);

View File

@ -972,6 +972,7 @@ Maximilian Mader https://github.com/max-m</property>
<child>
<object class="GtkComboBoxText">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="margin_left">5</property>
<property name="margin_right">5</property>
@ -1013,6 +1014,7 @@ Maximilian Mader https://github.com/max-m</property>
<child>
<object class="GtkSpinner">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">False</property>
<property name="margin_top">90</property>
<property name="margin_bottom">90</property>
@ -1127,6 +1129,7 @@ Maximilian Mader https://github.com/max-m</property>
<object class="GtkButton">
<property name="label" translatable="yes">Configure Joypad</property>
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="activate" handler="do_configure_joypad" swapped="no"/>