[PR #7900] Fix SendInput handling #27022

Open
opened 2026-01-31 09:19:32 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/7900

State: closed
Merged: Yes


While not explicitly permitted, a wide range of software (including
Windows' own touch keyboard) sets the wScan member of the KEYBDINPUT
structure to 0, resulting in scanCode being 0 as well. In these
situations we'll now use the vkey to get a scanCode.

Validation

  • AutoHotkey
    • Use a keyboard layout with AltGr key
    • Execute the following script:
      #NoEnv
      #Warn
      SendMode Input
      SetWorkingDir %A_ScriptDir%
      <^>!8::SendInput {Raw}»
      
    • Press AltGr+8 while the Terminal is in the foreground
    • Ensure » is being echoed ✔️
  • PowerToys
    • Add a Ctrl+I -> ↑ (up arrow) keyboard shortcut
    • Press Ctrl+I while the Terminal is in the foreground
    • Ensure the shell history is being navigated backwards ✔️
  • Windows Touch Keyboard
    • Right-click or tap and hold the taskbar and select "Show touch
      keyboard" button
    • Open touch keyboard
    • Ensure keyboard works like a regular keyboard ✔️
    • Ensure unicode characters are echoed on the Terminal as well (except
      for Emojis) ✔️

Closes #7438
Closes #7495
Closes #7843

**Original Pull Request:** https://github.com/microsoft/terminal/pull/7900 **State:** closed **Merged:** Yes --- While not explicitly permitted, a wide range of software (including Windows' own touch keyboard) sets the `wScan` member of the `KEYBDINPUT` structure to 0, resulting in `scanCode` being 0 as well. In these situations we'll now use the `vkey` to get a `scanCode`. Validation ---------- * AutoHotkey * Use a keyboard layout with `AltGr` key * Execute the following script: ```ahk #NoEnv #Warn SendMode Input SetWorkingDir %A_ScriptDir% <^>!8::SendInput {Raw}» ``` * Press `AltGr+8` while the Terminal is in the foreground * Ensure » is being echoed ✔️ * PowerToys * Add a `Ctrl+I -> ↑ (up arrow)` keyboard shortcut * Press `Ctrl+I` while the Terminal is in the foreground * Ensure the shell history is being navigated backwards ✔️ * Windows Touch Keyboard * Right-click or tap and hold the taskbar and select "Show touch keyboard" button * Open touch keyboard * Ensure keyboard works like a regular keyboard ✔️ * Ensure unicode characters are echoed on the Terminal as well (except for Emojis) ✔️ Closes #7438 Closes #7495 Closes #7843
claunia added the pull-request label 2026-01-31 09:19:32 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27022