Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Use the correct data type and MAPVK_VK_TO_CHAR constant from the WinSDK. #448

Merged
merged 1 commit into from
Jun 10, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions appshell/appshell_extensions_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1526,13 +1526,13 @@ bool UpdateAcceleratorTable(int32 tag, ExtensionString& keyStr)
lpaccelNew[newItem].key = ascii;
} else {
// Get the virtual key code for non-alpha-numeric characters.
int keyCode = ::VkKeyScan(ascii);
WORD vKey = (short)(keyCode & 0x000000FF);
bool isAltGr = ((keyCode & 0x0000FF00) >> 8) >= 6;
SHORT keyCode = ::VkKeyScan(ascii);
WORD vKey = (WORD)(keyCode & 0xFF);
bool isAltGr = ((keyCode & 0x600) == 0x600);

// Get unshifted key from keyCode so that we can determine whether the
// key is a shifted one or not.
UINT unshiftedChar = ::MapVirtualKey(vKey, 2);
UINT unshiftedChar = ::MapVirtualKey(vKey, MAPVK_VK_TO_CHAR);
bool isDeadKey = ((unshiftedChar & 0x80000000) == 0x80000000);

// If one of the following is found, then the shortcut is not available for the
Expand Down