Translation of DualSense commands using keyboard keys #602

Closed
github-bot wants to merge 1 commit from gh-pr/602/head into gh-pr/602/base
Owner

@⁠Ekt0re on GitHub · 2026-09-13 11:59 UTC · original
Ekt0re:feature/dualsense-keyboard-emulation → main · +1983 −195 · 18 files · 1 commits · closed without merging

Work in Progress:

Integration of a translation of DualSense commands using keyboard keys. Added a feedback overlay for the adaptive triggers, microphone volume, and gyroscope.

Known Issues:

  • Debug logs cause the gyroscope to malfunction.
  • Settings are not saved when the emulator or launcher is restarted.
  • The gyroscope moves to the right on only one axis.
  • The key mapping for R3/L3 is missing -> T and V keys

To be tested:

  • Compatibility with DS4 / DS5 / Xbox

The current plan I'm following:

Input Translation Layer from Keyboard to DualSense PS5

# DualSense Input Keyboard + Mouse Fallback
1 D-pad Up Arrow ↑ 1
2 D-pad Left Arrow ← 2
3 D-pad Down Arrow ↓ 3
4 D-pad Right Arrow → 4
5 Create / Share \ 9
6 Left Stick WASD WASD
7 Right Stick Mouse (movement) Numeric keys
8 Microphone Real microphone input M + mouse wheel (continuous) or M + N + +/-/= (step 0/25/50/75/100)
9 Touch press (click) Backspace Backspace / Touch input on trackpad (e.g. laptops) / Mouse wheel click
10 Options Enter Enter
11 Square J Z
12 Cross K Shift
13 Circle L X
14 Triangle I C
15 L1 Q Q
16 L2 (analog 0-255) Right click = 100%; Right click+Tab+wheel = continuous; Right click+Tab++/-/= = step (signal active as long as click is held) R = 100% click / Tab+R or Tab+Q (hold) + wheel/+/-/= (does not generate L1, but adjusts L2 press force)
17 R1 E E
18 R2 (analog 0-255) Left click = 100%; Left click+Tab+wheel = continuous; Left click+Tab++/-/= = step (signal active as long as click is held) F = 100% click / Tab+F or Tab+E (hold) + wheel/+/-/= (does not generate R1, but adjusts R2 press force)
19 Gyroscope 7 + wheel down = rotate right; 7 + wheel up = rotate left 7++ = rotate right; 7+- = rotate left; 7+= = reset (signal active as long as 7 is held)
20 Touch (drag/swipe) Touch/Trackpad, invoked with H, otherwise the trackpad acts as a mouse. H+directional arrows = swipe direction; H + Y = swipe up, H + U = swipe right, H + G = swipe left, H + B = swipe down (shortcuts)
21 PS Delete 6
22 L3 T
23 R3 V

General logic

  • Left hand: WASD (movement) + Q/E (bumpers) + Shift/Z/X/C (alternative face buttons)

  • Right hand: Mouse (camera/triggers) or IJKL (face buttons) + arrows/numbers (D-pad) in keyboard-only mode

  • Tab acts as a common modifier to enter "fine-adjustment mode" on L2/R2

  • Physical position/scancode of the key:
    Keyboard bindings are based on the physical position of the keys, using the QWERTY layout as the reference. The action associated with a key depends on its physical position/scancode, not on the character produced by the operating system's language layout. This way, the ergonomic layout of the configuration stays consistent across QWERTY, AZERTY, QWERTZ, and other layouts.

    • Example: the physical position occupied by the W key in the reference QWERTY layout corresponds to the Move Forward action.

    • The configuration GUI automatically adapts to the layout and physical configuration of the keyboard in use, showing the position and/or symbol of the corresponding key.

  • Last Active Input Source, meaning the emulator "remembers" the last input source received. Useful for UI and HUD.

  • The keyboard remains always active and serves as a fallback in case the controller disconnects or issues commands not supported by the controller.

  • Microphone input, if possible, is taken from a microphone connected to the PC; otherwise, it is taken from the M + mouse wheel key, or M + N + -/+/=.

  • "Adjustment Lock": pressing the "CAPS LOCK" key "locks" the analog adjustment until the "CAPS LOCK" key is pressed again. In other words, you can release the key combinations used for the analog adjustment and/or perform other analog adjustments; they will remain active until "CAPS LOCK" is pressed again, which will reset the analog adjustments.

    • This allows the analog adjustment to be "locked" globally. (Thus avoiding reset, and freeing up keys like Tab for further analog adjustments)
    • The reset returns all analog inputs to a Default state. Therefore, the R2 and L2 triggers return to 0, the gyroscope stops and returns flat, and the microphone returns to 0.
    • Conflict with the system's Caps Lock: This could occur when text needs to be entered. The system function is not suppressed, but when entering an input field, e.g., a virtual keyboard, Caps Lock behaves according to the system.
    • When Caps Lock captures the step value reached at that moment, it remains active until "CAPS LOCK" is pressed again. However, if while it is active you press a Tab + Wheel or Tab + +/-/= combination again, the step value is updated to the new value reached.
    • This freeze allows the analog adjustment to be "locked" for:
      • R2 / L2 triggers
      • Microphone
      • Gyroscope
    • When the Lock is active, the analog value remains set without needing to keep the adjustment keys held down. To modify it, the Tab + wheel / +/-/= combination must be pressed again, which updates the frozen value to the new level reached.

The configuration prioritizes:

  • WASD for movement.
  • Mouse for the right stick and therefore for the camera.
  • Mouse buttons for the analog triggers.
  • Q/E for L1/R1.
  • Shift/Z/X/C for the four face buttons in the Keyboard + Mouse configuration.
  • 1/2/3/4 as the D-pad fallback, accessible from the left hand.
  • Layering via modifiers for secondary or analog inputs.
  • Use of the PC's real microphone, when available.
  • Virtual fallbacks for microphone, gyroscope, adaptive triggers, and other inputs not directly available.
  • If the keys used for analog adjustment are released and the Caps Lock is not active, the system resets that analog input.

Compatibility notes:

  • The configuration is designed for the QWERTY keyboard layout.
  • Keys must be "ScanCode-based" so they are independent of keyboard format / adapt to the keyboard's format.
  • The configuration supports the following formats: 100%, 80%, 75%, 65%, 60%, Laptop.
  • In configurations <40%, the mapping may not be optimal and may require manual adjustments or the use of the Fn + .. key to access keys not present on the keyboard.
  • Every key is customizable via a dedicated configuration menu in the emulator's settings.

Notes on the PS and Create/Share functions:

  • The PS (PlayStation) function is mapped and can be activated; however, it does not open the PlayStation menu but opens an emulator-exclusive menu where you can view game statistics, trophies, etc.
  • The Create/Share function is mapped and can be activated; however, it does not open the Create/Share menu but opens an emulator-exclusive menu where you can create/share your gameplay.

Compatibility with DS4, Xbox, and third-party controllers:

  • The configuration is designed to be compatible with DS4, Xbox, and third-party controllers.
  • Functions not present on the controller are mapped to the corresponding PC fallbacks.

Feedback and Adaptive Triggers:

  • When adjustment mode is active and you're using the keyboard to gauge how much input you're applying, a colored frame border appears around the game, changing color based on intensity. (All based on gradients.)
  • If using a DS4 or Xbox controller, the same applies (as an activatable option for feedback given by vibration).
  • For gyroscope input via mouse and keyboard, a frame overlay appears when activated, showing a kind of colored bubble that moves in the direction the gyroscope moves.
  • Feedback can be enabled in the settings for the microphone, showing the corresponding input level.
  • Text input in games. If a game requests text input, it can be given directly via the keyboard, or through a virtual on-screen keyboard overlay navigable with arrows/joystick commands and touch.
  • Visual feedback elements, such as for the gyroscope, remain active only when in use/needed.
  • Each feedback option can be disabled from the settings.
  • Visual feedback for Caps Lock/analog adjustment lock. When the analog adjustment lock is active, the Caps Lock visual feedback is triggered — both as a light on the keyboard and on-screen, displaying (if enabled in the settings) the corresponding indicator and keeping it active until the analog input is stopped.

Input Capability Detection:

On startup of the Launcher and the emulator, the system automatically detects available input capabilities to provide debug information to users.
It also adapts feedback to the type of input in use.

Direct keyboard input option:

  • Some PlayStation games support mouse and keyboard input. For this reason, there is a setting option to disable controller emulation and expose the keyboard/mouse directly as input devices.
  • All logic described above would then be ignored and disabled.

Image of Keys and Key Mappings:

image (1)
**@⁠Ekt0re** on GitHub · 2026-09-13 11:59 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/602) `Ekt0re:feature/dualsense-keyboard-emulation` → `main` · +1983 −195 · 18 files · 1 commits · closed without merging ### Work in Progress: Integration of a translation of DualSense commands using keyboard keys. Added a feedback overlay for the adaptive triggers, microphone volume, and gyroscope. **Known Issues:** - Debug logs cause the gyroscope to malfunction. - Settings are not saved when the emulator or launcher is restarted. - The gyroscope moves to the right on only one axis. - The key mapping for R3/L3 is missing -> T and V keys **To be tested:** - Compatibility with DS4 / DS5 / Xbox ### **The current plan I'm following:** # Input Translation Layer from Keyboard to DualSense PS5 | # | DualSense Input | Keyboard + Mouse | Fallback | |---|---|---|---| | 1 | D-pad Up | Arrow ↑ | 1 | | 2 | D-pad Left | Arrow ← | 2 | | 3 | D-pad Down | Arrow ↓ | 3 | | 4 | D-pad Right | Arrow → | 4 | | 5 | Create / Share | \ | 9 | | 6 | Left Stick | WASD | WASD | | 7 | Right Stick | Mouse (movement) | Numeric keys | | 8 | Microphone | Real microphone input | M + mouse wheel (continuous) *or* M + N + `+/-/=` (step 0/25/50/75/100) | | 9 | Touch press (click) | Backspace | Backspace / Touch input on trackpad (e.g. laptops) / Mouse wheel click | | 10 | Options | Enter | Enter | | 11 | Square | J | Z | | 12 | Cross | K | Shift | | 13 | Circle | L | X | | 14 | Triangle | I | C | | 15 | L1 | Q | Q | | 16 | L2 (analog 0-255) | Right click = 100%; Right click+Tab+wheel = continuous; Right click+Tab+`+/-/=` = step (signal active as long as click is held) | R = 100% click / Tab+R or Tab+Q (hold) + wheel/`+/-/=` (does not generate L1, but adjusts L2 press force) | | 17 | R1 | E | E | | 18 | R2 (analog 0-255) | Left click = 100%; Left click+Tab+wheel = continuous; Left click+Tab+`+/-/=` = step (signal active as long as click is held) | F = 100% click / Tab+F or Tab+E (hold) + wheel/`+/-/=` (does not generate R1, but adjusts R2 press force) | | 19 | Gyroscope | `7` + wheel down = rotate right; `7` + wheel up = rotate left | `7`+`+` = rotate right; `7`+`-` = rotate left; `7`+`=` = reset (signal active as long as `7` is held) | | 20 | Touch (drag/swipe) | Touch/Trackpad, invoked with H, otherwise the trackpad acts as a mouse. | H+directional arrows = swipe direction; H + Y = swipe up, H + U = swipe right, H + G = swipe left, H + B = swipe down (shortcuts) | | 21 | PS | Delete | 6 | | 22 | L3 | T | | | 23 | R3 | V | | ## General logic - **Left hand**: WASD (movement) + Q/E (bumpers) + Shift/Z/X/C (alternative face buttons) - **Right hand**: Mouse (camera/triggers) or IJKL (face buttons) + arrows/numbers (D-pad) in keyboard-only mode - **Tab** acts as a common modifier to enter "fine-adjustment mode" on L2/R2 - **Physical position/scancode of the key:** Keyboard bindings are based on the physical position of the keys, using the QWERTY layout as the reference. The action associated with a key depends on its physical position/scancode, not on the character produced by the operating system's language layout. This way, the ergonomic layout of the configuration stays consistent across QWERTY, AZERTY, QWERTZ, and other layouts. - Example: *the physical position occupied by the `W` key in the reference QWERTY layout corresponds to the `Move Forward` action.* - The configuration GUI automatically adapts to the layout and physical configuration of the keyboard in use, showing the position and/or symbol of the corresponding key. - **Last Active Input Source**, meaning the emulator "remembers" the last input source received. Useful for UI and HUD. - **The keyboard remains always active** and serves as a fallback in case the controller disconnects or issues commands not supported by the controller. - **Microphone input**, if possible, is taken from a microphone connected to the PC; otherwise, it is taken from the M + mouse wheel key, or M + N + `-/+/=`. - **"Adjustment Lock"**: pressing the "CAPS LOCK" key "locks" the analog adjustment until the "CAPS LOCK" key is pressed again. In other words, you can release the key combinations used for the analog adjustment and/or perform other analog adjustments; they will remain active until "CAPS LOCK" is pressed again, which will reset the analog adjustments. - This allows the analog adjustment to be "locked" globally. (Thus avoiding reset, and freeing up keys like Tab for further analog adjustments) - The reset returns all analog inputs to a Default state. Therefore, the R2 and L2 triggers return to 0, the gyroscope stops and returns flat, and the microphone returns to 0. - Conflict with the system's Caps Lock: This could occur when text needs to be entered. The system function is not suppressed, but when entering an input field, e.g., a virtual keyboard, Caps Lock behaves according to the system. - When Caps Lock captures the step value reached at that moment, it remains active until "CAPS LOCK" is pressed again. However, if while it is active you press a Tab + Wheel or Tab + `+/-/=` combination again, the step value is updated to the new value reached. - This freeze allows the analog adjustment to be "locked" for: - R2 / L2 triggers - Microphone - Gyroscope - When the Lock is active, the analog value remains set without needing to keep the adjustment keys held down. To modify it, the Tab + wheel / `+/-/=` combination must be pressed again, which updates the frozen value to the new level reached. ## The configuration prioritizes: * WASD for movement. * Mouse for the right stick and therefore for the camera. * Mouse buttons for the analog triggers. * Q/E for L1/R1. * Shift/Z/X/C for the four face buttons in the Keyboard + Mouse configuration. * 1/2/3/4 as the D-pad fallback, accessible from the left hand. * Layering via modifiers for secondary or analog inputs. * Use of the PC's real microphone, when available. * Virtual fallbacks for microphone, gyroscope, adaptive triggers, and other inputs not directly available. * If the keys used for analog adjustment are released and the Caps Lock is not active, the system resets that analog input. ## Compatibility notes: * The configuration is designed for the QWERTY keyboard layout. * Keys must be "ScanCode-based" so they are independent of keyboard format / adapt to the keyboard's format. * The configuration supports the following formats: 100%, 80%, 75%, 65%, 60%, Laptop. * In configurations <40%, the mapping may not be optimal and may require manual adjustments or the use of the Fn + .. key to access keys not present on the keyboard. * Every key is customizable via a dedicated configuration menu in the emulator's settings. ## Notes on the PS and Create/Share functions: * The PS (PlayStation) function is mapped and can be activated; however, it does not open the PlayStation menu but opens an emulator-exclusive menu where you can view game statistics, trophies, etc. * The Create/Share function is mapped and can be activated; however, it does not open the Create/Share menu but opens an emulator-exclusive menu where you can create/share your gameplay. ## Compatibility with DS4, Xbox, and third-party controllers: * The configuration is designed to be compatible with DS4, Xbox, and third-party controllers. * Functions not present on the controller are mapped to the corresponding PC fallbacks. ## Feedback and Adaptive Triggers: * When adjustment mode is active and you're using the keyboard to gauge how much input you're applying, a colored frame border appears around the game, changing color based on intensity. (All based on gradients.) * If using a DS4 or Xbox controller, the same applies (as an activatable option for feedback given by vibration). * For gyroscope input via mouse and keyboard, a frame overlay appears when activated, showing a kind of colored bubble that moves in the direction the gyroscope moves. * Feedback can be enabled in the settings for the microphone, showing the corresponding input level. * Text input in games. If a game requests text input, it can be given directly via the keyboard, or through a virtual on-screen keyboard overlay navigable with arrows/joystick commands and touch. * Visual feedback elements, such as for the gyroscope, remain active only when in use/needed. * Each feedback option can be disabled from the settings. * Visual feedback for Caps Lock/analog adjustment lock. When the analog adjustment lock is active, the Caps Lock visual feedback is triggered — both as a light on the keyboard and on-screen, displaying (if enabled in the settings) the corresponding indicator and keeping it active until the analog input is stopped. ## Input Capability Detection: On startup of the Launcher and the emulator, the system automatically detects available input capabilities to provide debug information to users. It also adapts feedback to the type of input in use. ## Direct keyboard input option: * Some PlayStation games support mouse and keyboard input. For this reason, there is a setting option to disable controller emulation and expose the keyboard/mouse directly as input devices. * All logic described above would then be ignored and disabled. ### **Image of Keys and Key Mappings:** <img width="400" height="400" alt="image (1)" src="https://github.com/user-attachments/assets/57f552e6-0beb-4434-8e59-07765291ee4d" />
Known Issues:
- Debug logs cause the gyroscope to malfunction.
- Settings are not saved when the emulator or launcher is restarted.
- The gyroscope moves to the right on only one axis.
- The key mapping for R3/L3 is missing -> T and V keys

To be tested:
- Compatibility with DS4 / DS5 / Xbox
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:27:03 +00:00
github-bot closed this pull request 2026-11-26 09:27:03 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-13 11:59 UTC · original

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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 help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-13 11:59 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/602#issuecomment-5653121363) <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- This is an auto-generated comment: skip review by coderabbit.ai --> > [!IMPORTANT] > ## Draft PR not reviewed > > Draft PRs are not automatically reviewed by default. > > - [ ] <!-- {"checkboxId":"e9bb8d72-00e8-4f67-9cb2-caf3b22574fe"} --> Trigger a manual review > > To automatically review draft PRs, update your CodeRabbit configuration: > > ```yaml > reviews: > auto_review: > drafts: true > ``` <!-- end of auto-generated comment: skip review by coderabbit.ai --> <!-- tips_start --> --- Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=602)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.