Skip to content

fix(input): prevent keyboard and mouse input collisions - #6792

Open
crazycat256 wants to merge 1 commit into
MeteorDevelopment:masterfrom
crazycat256:fix/input-device-collisions
Open

crazycat256 wants to merge 1 commit into
MeteorDevelopment:masterfrom
crazycat256:fix/input-device-collisions

Conversation

@crazycat256

Copy link
Copy Markdown
Contributor

Type of change

  • Bug fix
  • New feature

Description

SDL keyboard scancodes and mouse buttons can share the same numeric value. Freecam and GUIMove compared these values without checking the input type, allowing mouse clicks to trigger keyboard movement.

For example, using Zoom bound to mouse button 4 while Freecam is active could trigger left movement, since SDL scancode 4 also represents the physical A key (Q on AZERTY).

The fix compares both the input type and value in Freecam and GUIMove, so mouse buttons no longer trigger unrelated keyboard bindings. It also applies the same distinction to input state tracking and the Keyboard HUD.

Related issues

No matching issue found.

How Has This Been Tested?

By trying to reproduce the bug with and without the fix in both dev and prod environments.

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant