+ case WM_KEYUP:
+ case WM_SYSKEYUP:
+ /*
+ * We handle KEYUP ourselves in order to distinghish left
+ * and right Alt or Control keys, which Windows won't do
+ * right if left to itself. See also the special processing
+ * at the top of TranslateKey.
+ */
+ {
+ BYTE keystate[256];
+ int ret = GetKeyboardState(keystate);
+ if (ret && wParam == VK_MENU) {
+ if (lParam & 0x1000000) keystate[VK_RMENU] = 0;
+ else keystate[VK_LMENU] = 0;
+ SetKeyboardState (keystate);
+ }
+ if (ret && wParam == VK_CONTROL) {
+ if (lParam & 0x1000000) keystate[VK_RCONTROL] = 0;
+ else keystate[VK_LCONTROL] = 0;
+ SetKeyboardState (keystate);
+ }
+ }
+ /*
+ * We don't return here, in order to allow Windows to do
+ * its own KEYUP processing as well.
+ */
+ break;