Skip to content

feat: major input handling overhaul with analog triggers and touchpad support#1

Open
postadelmaga wants to merge 1 commit intoniehoff90:mainfrom
postadelmaga:touchpad-analog-improvements
Open

feat: major input handling overhaul with analog triggers and touchpad support#1
postadelmaga wants to merge 1 commit intoniehoff90:mainfrom
postadelmaga:touchpad-analog-improvements

Conversation

@postadelmaga
Copy link
Copy Markdown

Summary

  • Replace busy-wait sleep(0.001) loop with epoll for zero CPU usage
  • Add SIGINT/SIGTERM handlers for clean device cleanup on Ctrl+C
  • Map LT/RT as analog triggers (ABS_Z/ABS_RZ) instead of digital buttons
  • Add BTN_MODE (Xbox/Guide button) on F key
  • Detect touchpad automatically (devices with ABS_X) and use 2-finger touch for right stick
  • Add dead zone, power curve, and exponential smoothing for touchpad 2-finger input
  • Auto-center right stick on finger lift
  • Change vendor/product ID to Xbox 360 (045e:028e) for better browser/game compatibility
  • Remove custom keys.h in favor of standard linux/input-event-codes.h
  • Print keymap on startup

Usage

sudo ./emulator --keyboard="/dev/input/event3" --mouse="/dev/input/event9"
  • 1 finger on touchpad = normal mouse cursor
  • 2 fingers on touchpad = right stick (with smoothing and power curve)

… support

- Replace busy-wait loop with epoll for zero CPU usage
- Add SIGINT/SIGTERM handlers for clean device cleanup
- Map LT/RT as analog triggers (ABS_Z/ABS_RZ) instead of digital
- Add BTN_MODE (Xbox/Guide button) on F key
- Detect touchpad automatically and use 2-finger touch for right stick
- Add dead zone, power curve, and exponential smoothing for touchpad
- Auto-center right stick on finger lift
- Change vendor/product ID to Xbox 360 (045e:028e) for better browser compat
- Remove custom keys.h in favor of linux/input-event-codes.h
- Print keymap on startup
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