This changes the KeyboardInput struct in sendinput.py to use the MAPVK_VK_TO_VSC_EX map type when translating virtual key codes on modern versions of Windows. The KEYEVENTF_EXTENDEDKEY flag is added only if the scan code has a high byte of 0xe0 or 0xe1, as per the documentation for MapVirtualKeyExW() (available here).
This changes the
KeyboardInput
struct insendinput.py
to use theMAPVK_VK_TO_VSC_EX
map type when translating virtual key codes on modern versions of Windows. TheKEYEVENTF_EXTENDEDKEY
flag is added only if the scan code has a high byte of0xe0
or0xe1
, as per the documentation forMapVirtualKeyExW()
(available here).This removes the hardcoded list of extended keys.
This fixes (again) issue #287.