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

Commit 3a10ec9

Browse files
committed
Use the correct data type and MAPVK_VK_TO_CHAR constant from the WinSDK.
1 parent 6943048 commit 3a10ec9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

appshell/appshell_extensions_win.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1526,13 +1526,13 @@ bool UpdateAcceleratorTable(int32 tag, ExtensionString& keyStr)
15261526
lpaccelNew[newItem].key = ascii;
15271527
} else {
15281528
// Get the virtual key code for non-alpha-numeric characters.
1529-
int keyCode = ::VkKeyScan(ascii);
1530-
WORD vKey = (short)(keyCode & 0x000000FF);
1531-
bool isAltGr = ((keyCode & 0x0000FF00) >> 8) >= 6;
1529+
SHORT keyCode = ::VkKeyScan(ascii);
1530+
WORD vKey = (WORD)(keyCode & 0xFF);
1531+
bool isAltGr = ((keyCode & 0x600) == 0x600);
15321532

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

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

0 commit comments

Comments
 (0)