HomeFreeBSD

hid/hgame: Fix desync in hgame_dpad_cb()

Description

hid/hgame: Fix desync in hgame_dpad_cb()

hgame_dpad_cb() previously exited early whenever conflicting directions
were input (e.g., UP + DOWN) without saving said input to the
hgame_softc state. This led to a desync between the driver and the
gamepad.

This patch instead handles conflicting inputs by cancelling them out
with each other.

Remove early return. Calculate axis value by subtraction.

Reviewed by: obiwac
Approved by: obiwac
Differential Revision: https://reviews.freebsd.org/D55849

Details

Provenance
majedalkhaleefah_gmail.comAuthored on Mar 24 2026, 6:37 AM
obiwacCommitted on Mar 24 2026, 6:37 AM
Reviewer
obiwac
Differential Revision
D55849: hid/hgame: Fix desync in hgame_dpad_cb()
Parents
rGc6bcf6e6fd50: pf: include all elements when hashing rules
Branches
Unknown
Tags
Unknown