From eebb14db05a64fc0e8acb8145fe07c3a6d57f1bf Mon Sep 17 00:00:00 2001 From: Aaron Meriwether Date: Wed, 6 Mar 2019 11:47:46 -0600 Subject: [PATCH] Include scancode information in keyboard events when possible --- Source/Keyboard.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Keyboard.cc b/Source/Keyboard.cc index 035a757..b1f21df 100644 --- a/Source/Keyboard.cc +++ b/Source/Keyboard.cc @@ -386,6 +386,7 @@ void Keyboard::Press (Key keycode) const // Attach the keycode input.ki.wVk = keycode; input.ki.dwFlags = 0; + input.ki.wScan = MapVirtualKey(keycode, MAPVK_VK_TO_VSC); // Send the prepared key input event SendInput (1, &input, sizeof (INPUT)); @@ -436,6 +437,7 @@ void Keyboard::Release (Key keycode) const // Attach the keycode input.ki.wVk = keycode; input.ki.dwFlags = KEYEVENTF_KEYUP; + input.ki.wScan = MapVirtualKey(keycode, MAPVK_VK_TO_VSC); // Send the prepared key input event SendInput (1, &input, sizeof (INPUT));