Skip to content

Commit 3b3b3a0

Browse files
committed
supress rx, ry axis events when heuristic for secondary stick is used
1 parent afd78ea commit 3b3b3a0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/win/wjoydxnu.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,19 +1532,19 @@ static void update_joystick(ALLEGRO_JOYSTICK_DIRECTX *joy)
15321532
const int dwOfs = item->dwOfs;
15331533
const DWORD dwData = item->dwData;
15341534

1535-
if (joy->rx_mapping.j && joy->rx_mapping.j == dwOfs)
1536-
handle_axis_event(joy, &joy->rx_mapping, dwData);
1537-
else if (joy->ry_mapping.j && joy->ry_mapping.j == dwOfs)
1538-
handle_axis_event(joy, &joy->ry_mapping, dwData);
1539-
else if (dwOfs == DIJOFS_X)
1535+
if (dwOfs == DIJOFS_X)
15401536
handle_axis_event(joy, &joy->x_mapping, dwData);
15411537
else if (dwOfs == DIJOFS_Y)
15421538
handle_axis_event(joy, &joy->y_mapping, dwData);
15431539
else if (dwOfs == DIJOFS_Z)
15441540
handle_axis_event(joy, &joy->z_mapping, dwData);
1545-
else if (dwOfs == DIJOFS_RX)
1541+
else if (joy->rx_mapping.j && joy->rx_mapping.j == dwOfs)
1542+
handle_axis_event(joy, &joy->rx_mapping, dwData);
1543+
else if (joy->ry_mapping.j && joy->ry_mapping.j == dwOfs)
1544+
handle_axis_event(joy, &joy->ry_mapping, dwData);
1545+
else if (joy->rx_mapping.j == 0 && dwOfs == DIJOFS_RX)
15461546
handle_axis_event(joy, &joy->rx_mapping, dwData);
1547-
else if (dwOfs == DIJOFS_RY)
1547+
else if (joy->rx_mapping.j == 0 && dwOfs == DIJOFS_RY)
15481548
handle_axis_event(joy, &joy->ry_mapping, dwData);
15491549
else if (dwOfs == DIJOFS_RZ)
15501550
handle_axis_event(joy, &joy->rz_mapping, dwData);

0 commit comments

Comments
 (0)