mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-03-31 09:17:04 +09:00
Workaround weird steam input (in-game) behavior where steam triggers playstation button + options when pressing both l3 and r3 at the same time
This commit is contained in:
@@ -56,6 +56,8 @@ namespace gsr {
|
|||||||
bool down_pressed = false;
|
bool down_pressed = false;
|
||||||
bool left_pressed = false;
|
bool left_pressed = false;
|
||||||
bool right_pressed = false;
|
bool right_pressed = false;
|
||||||
|
bool l3_button_pressed = false;
|
||||||
|
bool r3_button_pressed = false;
|
||||||
|
|
||||||
bool save_replay = false;
|
bool save_replay = false;
|
||||||
bool save_1_min_replay = false;
|
bool save_1_min_replay = false;
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ namespace gsr {
|
|||||||
static constexpr int triangle_button = 2;
|
static constexpr int triangle_button = 2;
|
||||||
static constexpr int options_button = 9;
|
static constexpr int options_button = 9;
|
||||||
static constexpr int playstation_button = 10;
|
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_up_down = 7;
|
||||||
static constexpr int axis_left_right = 6;
|
static constexpr int axis_left_right = 6;
|
||||||
|
|
||||||
@@ -266,7 +268,8 @@ namespace gsr {
|
|||||||
if((event.type & JS_EVENT_BUTTON) == JS_EVENT_BUTTON) {
|
if((event.type & JS_EVENT_BUTTON) == JS_EVENT_BUTTON) {
|
||||||
switch(event.number) {
|
switch(event.number) {
|
||||||
case playstation_button: {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case options_button: {
|
case options_button: {
|
||||||
@@ -284,6 +287,14 @@ namespace gsr {
|
|||||||
save_10_min_replay = true;
|
save_10_min_replay = true;
|
||||||
break;
|
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) {
|
} else if((event.type & JS_EVENT_AXIS) == JS_EVENT_AXIS && playstation_button_pressed) {
|
||||||
const int trigger_threshold = 16383;
|
const int trigger_threshold = 16383;
|
||||||
|
|||||||
Reference in New Issue
Block a user