Fix SendInput handling (#7900)

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
This commit is contained in:
Leonard Hecker
2020-10-27 20:06:29 +01:00
committed by GitHub
parent 1df3182865
commit d51d8dc768
4 changed files with 23 additions and 43 deletions

View File

@@ -0,0 +1,7 @@
autogenerated
CPPCORECHECK
Debian
filepath
inplace
KEYBDINPUT
WINVER

View File

@@ -33,7 +33,6 @@ AHelper
ahz
AImpl
AInplace
akb
ALIGNRIGHT
alloc
allocing
@@ -62,7 +61,6 @@ apiset
apos
APPBARDATA
appconsult
appdata
APPICON
appium
applet
@@ -109,10 +107,8 @@ aumid
Authenticode
AUTOBUDDY
AUTOCHECKBOX
Autogenerated
autohide
AUTOHSCROLL
autologin
automagically
autopositioning
AUTORADIOBUTTON
@@ -393,7 +389,6 @@ CPINFOEX
cplinfo
cplusplus
cpp
cppcorecheck
cppcorecheckrules
cpprest
cpprestsdk
@@ -510,10 +505,8 @@ DDESHARE
DDevice
DEADCHAR
dealloc
debian
debolden
debounce
debugbreak
DECALN
DECANM
DECAUPSS
@@ -521,11 +514,9 @@ DECAWM
DECCKM
DECCOLM
DECEKBD
decf
DECKPAM
DECKPM
DECKPNM
DECLL
DECLRMM
decls
declspec
@@ -552,7 +543,6 @@ DECSEL
DECSET
DECSLPP
DECSLRM
DECSMBV
DECSMKR
DECSR
decstandar
@@ -716,7 +706,6 @@ EPres
ERASEBKGND
errno
errorlevel
esa
ETB
etcoreapp
ETW
@@ -771,7 +760,6 @@ fgetwc
fgidx
FILEDESCRIPTION
fileno
FILEPATH
FILESUBTYPE
FILESYSPATH
filesystem
@@ -932,7 +920,6 @@ GTP
guc
gui
guidatom
guidgenerator
GValue
GWL
GWLP
@@ -1105,7 +1092,6 @@ Inlines
INotify
inout
INPATHROOT
Inplace
inproc
Inputkeyinfo
INPUTPROCESSORPROFILE
@@ -1194,11 +1180,9 @@ kcud
kcuf
kcuu
Kd
keith
kernelbase
kernelbasestaging
keybinding
keybound
keychord
keydown
keyevent
@@ -1471,7 +1455,6 @@ namestream
Namquiseratal
nano
natvis
naws
nbsp
Nc
NCCALCSIZE
@@ -1553,7 +1536,6 @@ NOTNULL
NOTOPMOST
NOTRACK
NOTSUPPORTED
notypeopt
nouicompat
nounihan
NOUPDATE
@@ -1628,7 +1610,6 @@ opencon
openconsole
OPENIF
OPENLINK
openlogo
openps
opensource
openvt
@@ -1968,7 +1949,6 @@ resheader
resizable
resmimetype
restrictedcapabilities
restrictederrorinfo
resw
resx
retval
@@ -1995,7 +1975,6 @@ rgw
rgwch
rhs
ri
richturn
RIGHTALIGN
RIGHTBUTTON
riid
@@ -2069,7 +2048,6 @@ SCROLLSCALE
SCROLLSCREENBUFFER
Scrollup
Scrolluppage
Scs
scursor
sddl
sdeleted
@@ -2243,7 +2221,6 @@ subkey
SUBLANG
sublicensable
submenu
subnegotiation
subresource
subspan
substr
@@ -2254,7 +2231,6 @@ svg
swapchain
swapchainpanel
swappable
Switchto
SWMR
SWP
swprintf
@@ -2309,7 +2285,6 @@ technet
tellp
telnet
telnetd
telnetpp
templated
terminalcore
TERMINALSCROLLING
@@ -2706,12 +2681,10 @@ wintelnet
winternl
winuser
winuserp
winver
wistd
wixproj
wline
wlinestream
Wlk
wmain
WMSZ
wnd
@@ -2754,7 +2727,6 @@ WRunoff
WScript
wsl
WSLENV
wslhome
wsmatch
WSpace
wss