Skip to content

Commit

Permalink
Revert "Fixes #1: use different method to extract physical key in the…
Browse files Browse the repository at this point in the history
… no modifier case for windows"

This reverts commit 966f8cf.
  • Loading branch information
alexdima committed Oct 5, 2016
1 parent 70a77c8 commit 0e385f7
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/keyboard_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,30 +198,18 @@ void ClearKeyboardBuffer(ui::KeyboardCode key_code, UINT scan_code, BYTE* keyboa
std::string GetStrFromKeyPress(ui::KeyboardCode key_code, int modifiers, BYTE *keyboard_state, ui::KeyboardCode clear_key_code, UINT clear_scan_code) {
memset(keyboard_state, 0, 256);

bool hasModifiers = false;

if (modifiers & kShiftKeyModifierMask) {
hasModifiers = true;
keyboard_state[VK_SHIFT] |= 0x80;
}

if (modifiers & kControlKeyModifierMask) {
hasModifiers = true;
keyboard_state[VK_CONTROL] |= 0x80;
}

if (modifiers & kAltKeyModifierMask) {
hasModifiers = true;
keyboard_state[VK_MENU] |= 0x80;
}

if (!hasModifiers) {
wchar_t key = LOWORD(::MapVirtualKeyW(key_code, MAPVK_VK_TO_CHAR));
if (key) {
return vscode_keyboard::UTF16toUTF8(&key, 1);
}
}

UINT scan_code = ::MapVirtualKeyW(key_code, MAPVK_VK_TO_VSC);

wchar_t chars[5];
Expand Down

0 comments on commit 0e385f7

Please sign in to comment.