Changeset 9607 for trunk/src/user32/oslibmsgtranslate.cpp
- Timestamp:
- Jan 4, 2003, 1:21:44 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibmsgtranslate.cpp
r9598 r9607 1 /* $Id: oslibmsgtranslate.cpp,v 1.9 7 2003-01-03 16:35:54 sandervl Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.98 2003-01-04 12:21:44 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 646 646 #endif 647 647 648 #ifdef ALTGR_HACK649 650 651 if (usPMScanCode == PMSCAN_ALTRIGHT)652 {653 // Turn message into CTRL-event654 // The original PM message is still saved inside655 // the TEB, the next call to TranslateMessage()656 // will then generate the required additional message657 // for the ALTGR-event.658 winMsg->wParam = VK_LCONTROL_W;659 winMsg->lParam = repeatCount & 0x0FFFF;660 winMsg->lParam |= WINSCAN_CTRLLEFT << 16661 | WIN_KEY_DONTCARE;662 663 if (flags & KC_KEYUP)664 {665 winMsg->message = WINWM_SYSKEYUP;666 winMsg->lParam |= WIN_KEY_ALTHELD; // bit 29, alt was pressed667 winMsg->lParam |= WIN_KEY_PREVSTATE; // bit 30, previous state, always 1 for a WM_KEYUP message668 winMsg->lParam |= 1 << 31; // bit 31, transition state, always 1 for WM_KEYUP669 670 // Note: altgr affects the alt-key state in windows!671 // The overlay causes GetKeyState/GetAsyncKeyState to return672 // the correct states673 KeySetOverlayKeyState(VK_LCONTROL_W, KEYOVERLAYSTATE_DONTCARE);674 KeySetOverlayKeyState(VK_CONTROL_W, KEYOVERLAYSTATE_DONTCARE);675 }676 else677 {678 winMsg->lParam |= WIN_KEY_ALTHELD;679 if (keyWasPressed)680 winMsg->lParam |= WIN_KEY_PREVSTATE; // bit 30, previous state, 1 means key was pressed681 winMsg->message = WINWM_KEYDOWN;682 683 // Note: altgr affects the alt-key state in windows!684 // The overlay causes GetKeyState/GetAsyncKeyState to return685 // the correct states686 KeySetOverlayKeyState(VK_LCONTROL_W, KEYOVERLAYSTATE_DOWN);687 KeySetOverlayKeyState(VK_CONTROL_W, KEYOVERLAYSTATE_DOWN);688 KeySetOverlayKeyState(VK_RMENU_W, KEYOVERLAYSTATE_DOWN);689 KeySetOverlayKeyState(VK_MENU_W, KEYOVERLAYSTATE_DOWN);690 691 // Note: when CTRL comes up, windows keeps ALTGR still down!692 // KeySetOverlayKeyState(VK_RMENU_W, KEYOVERLAYSTATE_DOWN);693 }694 }695 #endif696 648 697 649 //@PF This looks ugly but this is just what we have in win32 both in win98/win2k … … 811 763 } 812 764 } 813 814 #ifdef ALTGR_HACK815 // it's a PMSCAN_ALTRIGHT WM_CHAR message?816 // and not previously translated?817 if(fMsgRemoved && usPMScanCode == PMSCAN_ALTRIGHT && !(teb->o.odin.fTranslated))818 {819 dprintf(("Queue ALTRIGHT message"));820 // special ALTRIGHT treatment:821 // we try to insert another WM_KEYDOWN or WM_KEYUP instead of822 // the usual WM_CHAR which is expected here.823 // -> experimental824 // it's really an OS/2-style WM_CHAR message?825 MSG extramsg;826 memcpy(&extramsg, winMsg, sizeof(MSG));827 828 // AltGr is not released with WINWM_SYSKEYUP, but WINWM_KEYUP829 if(flags & KC_KEYUP)830 {831 extramsg.message = WINWM_KEYUP;832 }833 extramsg.wParam = VK_RMENU_W;834 835 // mask out message bits and scan code836 extramsg.lParam &= (0xDC00FFFF);837 extramsg.lParam |= (WINSCAN_ALTRIGHT & 0x1FF) << 16;838 //// extramsg.lParam |= WIN_KEY_EXTENDED;839 if (!(flags & KC_KEYUP))840 extramsg.lParam |= WIN_KEY_ALTHELD;841 842 // insert message into the queue843 setThreadQueueExtraCharMessage(teb, &extramsg);844 }845 #endif846 765 break; 847 766 }
Note:
See TracChangeset
for help on using the changeset viewer.