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

Commit

Permalink
Merge pull request #448 from adobe/rlim/altGr-key-issue
Browse files Browse the repository at this point in the history
Use the correct data type and MAPVK_VK_TO_CHAR constant from the WinSDK.
  • Loading branch information
JeffryBooher committed Jun 10, 2014
2 parents f520131 + 3a10ec9 commit 80522ca
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 80522ca

Please sign in to comment.