Skip to content

event-mapping: Make hat to buttons mapping always emit button release

When a hat mapped to two buttons was quickly pressed, with only the extreme values reported and not the neutral point, there wasn't any button release event for the direction that was moved from, and so it was still recorded as pressed.

This commits fixes it, by taking account the common event value and sending a button release event when it's detected as going in the opposite direction.

FIXME: it reports button release events for the opposite direction even when you move from center to a direction, which is bad. I wonder if there's a way to prevent this without tracking states. Maybe it isn't that bad.

Fixes #18

/cc @exalm if you're curious to see how I did it

Merge request reports