How raafatturki/joyscan works
JoyScan is a desktop gamepad diagnostic viewer. The user launches the app, connected controllers are discovered and selected, live button/axis values are sampled, and the current state is rendered as controller graphics, meters, and—when available—DualSense touch data. The main loop orchestrates discovery, device updates, layout, and drawing. The sampled sources show Linux HIDAPI integration and DualSense parsing; unsampled build and dependency internals are intentionally omitted.
Components 14
Application Flow
- Main Loop
src/main.c - Gamepad Registry
src/gamepad_list.h
Controller Input
- Raylib Gamepads
Diagnostic UI
- Layout Engine
src/layout.h - Button Meters
src/button_list.h - Controller View
src/controller.h - Touchpad View
src/touchpad_widget.h - SVG Renderer
src/svg.h - Raylib Graphics
DualSense Support
- DualSense Bridge
src/dualsense/dualsense.cpp - Linux HID Platform
src/dualsense/linux_hidapi_platform.cpp - HIDAPI
- DualSense State
src/dualsense/dualsense.h
Other components
- User
Connections 17
- User → Main Loop: operates
- Main Loop → Gamepad Registry: updates
- Gamepad Registry → Raylib Gamepads: enumerates
- Main Loop → DualSense Bridge: detects
- DualSense Bridge → Linux HID Platform: uses backend
- Linux HID Platform → HIDAPI: reads HID
- Main Loop → Layout Engine: arranges UI
- Main Loop → Button Meters: draws meters
- Button Meters → Raylib Gamepads: reads inputs
- Main Loop → Controller View: draws controller
- Controller View → Raylib Gamepads: reads axes
- Controller View → SVG Renderer: rasterizes state
- Controller View → Raylib Graphics: uploads texture
- Main Loop → Touchpad View: draws touchpad
- DualSense Bridge → DualSense State: writes state
- Main Loop → DualSense State: passes state
- Touchpad View → DualSense State: reads state