Input mapping tabs UI, emulated touchpad, and rumble for non-PS5 controllers #1541
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1541
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1541/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Pipe530 on GitHub · 2026-10-15 22:42 UTC · original
Pipe530:pipe530-input-mapping-tabs-ui→main· +1908 −209 · 18 files · 8 commits · merged 2026-10-16 02:04 UTCSummary
Pad:<Control>=<Source>) and a mappable gyro-emulation toggle (default Back/View) for pads without a gyroscope.assets/cursors(hand/drawing PNGs) with CMake copy/install rules.@coderabbitai[bot] on GitHub · 2026-10-15 22:47 UTC · original · edited 2026-10-16 01:24 UTC
📝 Walkthrough
The changes add separate keyboard and gamepad mappings, controller gyro emulation, and mouse and gamepad touchpad input. The overlay displays a touch cursor with optional cursor images, trails, and particles. CMake copies and installs cursor assets and adds host-input tests to the build and CI workflows. Non-speaker haptic streams for controllers other than PS5 gamepads now produce gamepad rumble.
Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Feature
Merge Risk: 🟡 Moderate · up to
5689fMouse drawing can trigger an unintended touchpad click or mapped game control, and the touch cursor can start at the wrong position. Correct these input behaviors before merging.
Pre-merge checks:
4 ·
1
Full details: Docstring Coverage
Explanation
Docstring coverage is 3.88% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 129 functions across 13 files. (3 skipped: 3 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@ -763,0 +772,4 @@"$<TARGET_FILE_DIR:kyty_emulator>/assets/cursors"VERBATIM)add_dependencies(kyty_emulator kyty_touch_cursors)install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/assets/cursors" DESTINATION assets)@coderabbitai[bot] on GitHub · 2026-10-15 22:47 UTC · original
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 2313
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 6680
Install cursors inside the macOS application bundle.
The generic install path is correct for non-bundle builds. On macOS,
kyty_emulatorinstalls toKytyPS5.app/Contents/MacOS, but the cursor rule installs to the prefix-levelassets/cursors.LoadTouchCursorImagetherefore looks inKytyPS5.app/Contents/MacOS/assets/cursorsand does not find the installed images.📝 Committable suggestion
@ -1194,0 +1471,4 @@}const auto now = Clock::now();if (state.enabled && state.position_valid) {const ImVec2 target {state.x * extent.width, state.y * extent.height};@coderabbitai[bot] on GitHub · 2026-10-15 22:47 UTC · original
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use the current frame extent for the cursor target.
DrawTouchPadCursorscales the normalized position by the memberextent.PrepareFrameassignsextent = frame_extentonly afterDrawTouchPadCursorreturns. On the first overlay frame,extentis{0, 0}. The cursor therefore starts at (0, 0) and then glides across the screen. If drawing is active, the glide also produces a trail and particles. After a resize, the cursor uses the old size for one frame. Passframe_extentintoDrawTouchPadCursor, or assignextentbefore the draw calls.🐛 Proposed fix
@ -213,1 +375,4 @@void SetSwipeTouchPad(bool down, float x, float y) {Controller::SetTouchPad(Controller::HOST_INPUT_CONTROLLER_ID, 1, down, x, y);}@coderabbitai[bot] on GitHub · 2026-10-15 22:47 UTC · original
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Mouse touchpad drawing presses the touchpad click button.
SetSwipeTouchPadcallsController::SetTouchPadwithHOST_INPUT_CONTROLLER_ID. For that ID,GameController::TouchPad(src/libs/controller.cpp, lines 591-594) setsPAD_BUTTON_TOUCH_PADwhiledownis true and clears it on release. Each mouse drag in touchpad mode therefore sends a held touchpad click to the game. Many games open a map or menu on touchpad click, so drawing triggers that action.There is a second effect. Releasing finger 1 clears the click bit even when the Backspace/
TouchPadbinding still holds finger 0. Gamepad drawing does not have this defect because it passes the gamepad ID.Separate "finger contact" from "click button" in the controller API. Leave the click bit unchanged for the swipe finger.
🐛 Proposed fix
In
src/libs/controller.cpp/controller.h:@ -441,0 +865,4 @@enabled = !g_mouse_touchpad.enabled;}HostInputSetTouchPadMode(enabled);}@coderabbitai[bot] on GitHub · 2026-10-15 22:47 UTC · original · edited 2026-10-16 01:18 UTC
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
F6 does nothing while gamepad touchpad mode is active.
GetHostInputTouchPadVisualState().enabledreturns true wheng_gamepad_touchpad.enabledis true. In that state, F6 or a keyboardTouchPadModebinding callsHostInputSetTouchPadMode(false). That function skips the gamepad disconnect becauseenabledis false. It then returns early becauseg_mouse_touchpad.enabledis already false. The key press has no effect. The user cannot switch to mouse touchpad mode until gamepad touchpad mode is turned off.Base the toggle on the mouse touchpad state only.
HostInputSetTouchPadMode(true)already disconnects the gamepad touchpad.🐛 Proposed fix
📝 Committable suggestion
✅ Addressed in commit
5689fd8@ -441,0 +895,4 @@g_gamepad_touchpad.y_axis = stick[1];g_gamepad_touchpad.last_poll = SDL_GetTicks();g_gamepad_touchpad.next_poll = g_gamepad_touchpad.last_poll + GAMEPAD_TOUCHPAD_POLL_MS;g_mouse_touchpad.gesture++;@coderabbitai[bot] on GitHub · 2026-10-15 22:47 UTC · original · edited 2026-10-16 01:18 UTC
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Turning on gamepad touchpad mode leaves the game's left stick at its last value.
When gamepad touchpad mode is on,
HostInputGamepadAxistakes every left-stick event, soController::SetAxisno longer receives them. Enabling the mode does not centerLeftX/LeftY. If the user holds the left stick while pressing the toggle, the game keeps that stick value for the whole mode. For example, the character keeps walking while the user moves the cursor.Center both axes when the mode turns on. Center them again when it turns off, because the axis cache resets to 128.
🐛 Proposed fix
✅ Addressed in commit
5689fd8@ -327,2 +327,4 @@return 0;}if (!stream->speaker &&SDL_GetGamepadTypeForID(static_cast<SDL_JoystickID>(controller)) != SDL_GAMEPAD_TYPE_PS5) {@coderabbitai[bot] on GitHub · 2026-10-15 22:47 UTC · original · edited 2026-10-16 01:18 UTC
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Close an active audio device before switching to rumble.
If a stream has an active DualSense audio device and
Queueis next called for a non-PS5 controller, this early branch bypassesRefreshDeviceandCloseDevice. The stream retains its old device and routing state until a later transition orClose. Close the old device when entering the rumble path.✅ Addressed in commit
5689fd8@coderabbitai[bot] on GitHub · 2026-10-15 22:47 UTC · original · edited 2026-10-16 01:18 UTC
On
src/libs/dualSenseHaptics.cppline 340 (outdated):🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Apply per-channel gains to rumble peaks.
When
gainsis non-null, this branch omitsgains[src_ch]. The DualSense audio path applies it at Line 385. As a result, a muted channel can still drive a rumble motor. Apply the same gain before measuring each peak.✅ Addressed in commit
5689fd8@coderabbitai[bot] on GitHub · 2026-10-15 22:47 UTC · original · reviewed
Actionable comments posted: 7
ℹ️ Review info
⚙️ Run configuration
fdd101a3-ee19-45f7-8bc1-67e09c0974d6📥 Commits
Reviewing files that changed from the base of the PR and between
9e41d8320aandb9c69dcadd.⛔ Files ignored due to path filters: 2
assets/cursors/drawing.pngis excluded by!**/*.pngassets/cursors/hand.pngis excluded by!**/*.png📒 Files selected for processing: 12
CMakeLists.txtsrc/graphics/presentation/systemOverlay.cppsrc/graphics/presentation/window/hostInput.cppsrc/graphics/presentation/window/hostInput.hsrc/graphics/presentation/window/window.cppsrc/launcher/include/controllerPreview.hsrc/launcher/include/inputMappingDialog.hsrc/launcher/src/controllerPreview.cppsrc/launcher/src/inputMappingDialog.cppsrc/libs/controller.cppsrc/libs/controller.hsrc/libs/dualSenseHaptics.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
@coderabbitai[bot] on GitHub · 2026-10-16 01:24 UTC · original · reviewed
ℹ️ Review info
⚙️ Run configuration
97830015-b87b-480c-b2b9-888381fa1c12📥 Commits
Reviewing files that changed from the base of the PR and between
b9c69dcaddand5689fd8c7f.📒 Files selected for processing: 11
.github/workflows/build.ymlCMakeLists.txtsrc/graphics/presentation/systemOverlay.cppsrc/graphics/presentation/window/hostInput.cppsrc/graphics/presentation/window/hostInput.hsrc/graphics/presentation/window/window.cppsrc/launcher/CMakeLists.txtsrc/launcher/src/inputMappingDialog.cppsrc/libs/dualSenseHaptics.cpptests/HostInputTests.cpptests/PadHapticsTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.