From 7f9f2db2fdf61f56eaea1d0f410964426a650ed3 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Tue, 21 Oct 2025 12:53:52 -0400 Subject: [PATCH 1/2] Throttle fixes --- src/game/joystick_standard.c | 43 +++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/src/game/joystick_standard.c b/src/game/joystick_standard.c index 59b3460a2..c0497b05a 100644 --- a/src/game/joystick_standard.c +++ b/src/game/joystick_standard.c @@ -267,9 +267,30 @@ joystick_standard_read_axis_3axis(UNUSED(void *priv), int axis) return joystick_state[gp][0].axis[0]; case 1: return joystick_state[gp][0].axis[1]; - case 2: + case 2: // Rudder Axis return joystick_state[gp][0].axis[2]; - case 3: + case 3: // Throttle Axis + default: + return 0; + } +} + +static int +joystick_standard_read_axis_3axis_throttle(UNUSED(void *priv), int axis) +{ + uint8_t gp = 0; + + if (!JOYSTICK_PRESENT(gp, 0)) + return AXIS_NOT_PRESENT; + + switch (axis) { + case 0: + return joystick_state[gp][0].axis[0]; + case 1: + return joystick_state[gp][0].axis[1]; + case 3: // Throttle Axis + return joystick_state[gp][0].axis[2]; + case 2: // Rudder Axis default: return 0; } @@ -288,10 +309,10 @@ joystick_standard_read_axis_4axis(UNUSED(void *priv), int axis) return joystick_state[gp][0].axis[0]; case 1: return joystick_state[gp][0].axis[1]; - case 2: - return joystick_state[gp][0].axis[2]; - case 3: + case 2: // Rudder Axis return joystick_state[gp][0].axis[3]; + case 3: // Throttle Axis + return joystick_state[gp][0].axis[2]; default: return 0; } @@ -487,7 +508,7 @@ const joystick_t joystick_3axis_2button = { .close = joystick_standard_close, .read = joystick_standard_read, .write = joystick_standard_write, - .read_axis = joystick_standard_read_axis_3axis, + .read_axis = joystick_standard_read_axis_3axis_throttle, .a0_over = joystick_standard_a0_over, .axis_count = 3, .button_count = 2, @@ -505,7 +526,7 @@ const joystick_t joystick_3axis_3button = { .close = joystick_standard_close, .read = joystick_standard_read_3button, .write = joystick_standard_write, - .read_axis = joystick_standard_read_axis_3axis, + .read_axis = joystick_standard_read_axis_3axis_throttle, .a0_over = joystick_standard_a0_over, .axis_count = 3, .button_count = 3, @@ -523,7 +544,7 @@ const joystick_t joystick_3axis_4button = { .close = joystick_standard_close, .read = joystick_standard_read_4button, .write = joystick_standard_write, - .read_axis = joystick_standard_read_axis_3axis, + .read_axis = joystick_standard_read_axis_3axis_throttle, .a0_over = joystick_standard_a0_over, .axis_count = 3, .button_count = 4, @@ -740,7 +761,7 @@ const joystick_t joystick_2button_yoke_throttle = { .close = joystick_standard_close, .read = joystick_standard_read, .write = joystick_standard_write, - .read_axis = joystick_standard_read_axis_3axis, + .read_axis = joystick_standard_read_axis_3axis_throttle, .a0_over = joystick_standard_a0_over, .axis_count = 3, .button_count = 2, @@ -758,7 +779,7 @@ const joystick_t joystick_3button_yoke_throttle = { .close = joystick_standard_close, .read = joystick_standard_read_3button, .write = joystick_standard_write, - .read_axis = joystick_standard_read_axis_3axis, + .read_axis = joystick_standard_read_axis_3axis_throttle, .a0_over = joystick_standard_a0_over, .axis_count = 3, .button_count = 3, @@ -776,7 +797,7 @@ const joystick_t joystick_4button_yoke_throttle = { .close = joystick_standard_close, .read = joystick_standard_read_4button, .write = joystick_standard_write, - .read_axis = joystick_standard_read_axis_3axis, + .read_axis = joystick_standard_read_axis_3axis_throttle, .a0_over = joystick_standard_a0_over, .axis_count = 3, .button_count = 4, From 6339f65087412b84ae69156036233cfcc6c486cb Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Tue, 21 Oct 2025 14:04:17 -0400 Subject: [PATCH 2/2] Swap axis names on CH products things with pedals --- src/game/joystick_ch_flightstick_pro.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/game/joystick_ch_flightstick_pro.c b/src/game/joystick_ch_flightstick_pro.c index 5c35b85a8..4d8a4cf29 100644 --- a/src/game/joystick_ch_flightstick_pro.c +++ b/src/game/joystick_ch_flightstick_pro.c @@ -256,7 +256,7 @@ const joystick_t joystick_ch_flightstick_ch_pedals = { .button_count = 2, .pov_count = 0, .max_joysticks = 1, - .axis_names = { "X axis (Roll)", "Y axis (Pitch)", "Throttle", "Rudder (Yaw)" }, + .axis_names = { "X axis (Roll)", "Y axis (Pitch)", "Rudder (Yaw)", "Throttle" }, .button_names = { "Trigger", "Button 2" }, .pov_names = { NULL } }; @@ -274,7 +274,7 @@ const joystick_t joystick_ch_flightstick_ch_pedals_pro = { .button_count = 2, .pov_count = 0, .max_joysticks = 1, - .axis_names = { "X axis (Roll)", "Y axis (Pitch)", "Right Pedal", "Left Pedal" }, + .axis_names = { "X axis (Roll)", "Y axis (Pitch)", "Left Pedal", "Right Pedal" }, .button_names = { "Trigger", "Button 2" }, .pov_names = { NULL } }; @@ -310,7 +310,7 @@ const joystick_t joystick_ch_flightstick_pro_ch_pedals = { .button_count = 4, .pov_count = 1, .max_joysticks = 1, - .axis_names = { "X axis (Roll)", "Y axis (Pitch)", "Throttle", "Rudder (Yaw)" }, + .axis_names = { "X axis (Roll)", "Y axis (Pitch)", "Rudder (Yaw)", "Throttle" }, .button_names = { "Trigger", "Button 2", "Button 3", "Button 4" }, .pov_names = { "POV" } }; @@ -328,7 +328,7 @@ const joystick_t joystick_ch_flightstick_pro_ch_pedals_pro = { .button_count = 4, .pov_count = 1, .max_joysticks = 1, - .axis_names = { "X axis (Roll)", "Y axis (Pitch)", "Right Pedal", "Left Pedal" }, + .axis_names = { "X axis (Roll)", "Y axis (Pitch)", "Left Pedal", "Right Pedal" }, .button_names = { "Trigger", "Button 2", "Button 3", "Button 4" }, .pov_names = { "POV" } }; @@ -364,7 +364,7 @@ const joystick_t joystick_ch_virtual_pilot_ch_pedals = { .button_count = 2, .pov_count = 0, .max_joysticks = 1, - .axis_names = { "X axis (Roll)", "Y axis (Pitch)", "Throttle", "Rudder (Yaw)" }, + .axis_names = { "X axis (Roll)", "Y axis (Pitch)", "Rudder (Yaw)", "Throttle" }, .button_names = { "Button 1", "Button 2" }, .pov_names = { NULL } }; @@ -382,7 +382,7 @@ const joystick_t joystick_ch_virtual_pilot_ch_pedals_pro = { .button_count = 2, .pov_count = 0, .max_joysticks = 1, - .axis_names = { "X axis (Roll)", "Y axis (Pitch)", "Right Pedal", "Left Pedal" }, + .axis_names = { "X axis (Roll)", "Y axis (Pitch)", "Left Pedal", "Right Pedal" }, .button_names = { "Button 1", "Button 2" }, .pov_names = { NULL } }; @@ -418,7 +418,7 @@ const joystick_t joystick_ch_virtual_pilot_pro_ch_pedals = { .button_count = 6, .pov_count = 2, .max_joysticks = 1, - .axis_names = { "X axis (Roll)", "Y axis (Pitch)", "Throttle", "Rudder (Yaw)" }, + .axis_names = { "X axis (Roll)", "Y axis (Pitch)", "Rudder (Yaw)", "Throttle" }, .button_names = { "Button 1", "Button 2", "Button 3", "Button 4", "Button 5", "Button 6" }, .pov_names = { "Right POV", "Left POV" } }; @@ -436,7 +436,7 @@ const joystick_t joystick_ch_virtual_pilot_pro_ch_pedals_pro = { .button_count = 6, .pov_count = 2, .max_joysticks = 1, - .axis_names = { "X axis (Roll)", "Y axis (Pitch)", "Right Pedal", "Left Pedal" }, + .axis_names = { "X axis (Roll)", "Y axis (Pitch)", "Left Pedal", "Right Pedal" }, .button_names = { "Button 1", "Button 2", "Button 3", "Button 4", "Button 5", "Button 6" }, .pov_names = { "Right POV", "Left POV" } };