aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/GlobalHotkeys/GlobalHotkeysJoystick.hpp2
-rw-r--r--src/GlobalHotkeys/GlobalHotkeysJoystick.cpp13
2 files changed, 14 insertions, 1 deletions
diff --git a/include/GlobalHotkeys/GlobalHotkeysJoystick.hpp b/include/GlobalHotkeys/GlobalHotkeysJoystick.hpp
index 4b266cb..0177d29 100644
--- a/include/GlobalHotkeys/GlobalHotkeysJoystick.hpp
+++ b/include/GlobalHotkeys/GlobalHotkeysJoystick.hpp
@@ -56,6 +56,8 @@ namespace gsr {
bool down_pressed = false;
bool left_pressed = false;
bool right_pressed = false;
+ bool l3_button_pressed = false;
+ bool r3_button_pressed = false;
bool save_replay = false;
bool save_1_min_replay = false;
diff --git a/src/GlobalHotkeys/GlobalHotkeysJoystick.cpp b/src/GlobalHotkeys/GlobalHotkeysJoystick.cpp
index 23f8a20..5969438 100644
--- a/src/GlobalHotkeys/GlobalHotkeysJoystick.cpp
+++ b/src/GlobalHotkeys/GlobalHotkeysJoystick.cpp
@@ -11,6 +11,8 @@ namespace gsr {
static constexpr int triangle_button = 2;
static constexpr int options_button = 9;
static constexpr int playstation_button = 10;
+ static constexpr int l3_button = 11;
+ static constexpr int r3_button = 12;
static constexpr int axis_up_down = 7;
static constexpr int axis_left_right = 6;
@@ -266,7 +268,8 @@ namespace gsr {
if((event.type & JS_EVENT_BUTTON) == JS_EVENT_BUTTON) {
switch(event.number) {
case playstation_button: {
- playstation_button_pressed = event.value == button_pressed;
+ // Workaround weird steam input (in-game) behavior where steam triggers playstation button + options when pressing both l3 and r3 at the same time
+ playstation_button_pressed = (event.value == button_pressed) && !l3_button_pressed && !r3_button_pressed;
break;
}
case options_button: {
@@ -284,6 +287,14 @@ namespace gsr {
save_10_min_replay = true;
break;
}
+ case l3_button: {
+ l3_button_pressed = event.value == button_pressed;
+ break;
+ }
+ case r3_button: {
+ r3_button_pressed = event.value == button_pressed;
+ break;
+ }
}
} else if((event.type & JS_EVENT_AXIS) == JS_EVENT_AXIS && playstation_button_pressed) {
const int trigger_threshold = 16383;