Changeset 9230 for trunk/src/user32/oslibmsgtranslate.cpp
- Timestamp:
- Sep 12, 2002, 11:30:06 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibmsgtranslate.cpp
r9200 r9230 1 /* $Id: oslibmsgtranslate.cpp,v 1.9 2 2002-09-03 14:03:16sandervl Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.93 2002-09-12 09:30:05 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 44 44 static BOOL fGenerateDoubleClick = FALSE; 45 45 static MSG doubleClickMsg = {0}; 46 47 //For wheel mouse translation 48 #define WHEEL_DELTA 120 49 #define OS2_WHEEL_CORRECTION 6 50 //This happens because OS/2 Wheel scrolling of IBM driver issues 6 WM_VSCROLL 51 //messages and they need to transform in 1 WM_MOUSEWHEEL. If however user 52 //will tweak driver to produce less or more messages, we will also react 46 53 47 54 //****************************************************************************** … … 921 928 case WM_HSCROLL: 922 929 case WM_VSCROLL: 923 winMsg->message = (os2Msg->msg == WM_HSCROLL) ? WINWM_HSCROLL : WINWM_VSCROLL; 924 winMsg->lParam = 0; 925 winMsg->wParam = 0; 926 switch(SHORT2FROMMP(os2Msg->mp2)) { 927 case SB_LINERIGHT: 928 winMsg->wParam = SB_LINERIGHT_W; 929 break; 930 case SB_LINELEFT: 931 winMsg->wParam = SB_LINELEFT_W; 932 break; 933 case SB_PAGELEFT: 934 winMsg->wParam = SB_PAGELEFT_W; 935 break; 936 case SB_PAGERIGHT: 937 winMsg->wParam = SB_PAGERIGHT_W; 938 break; 939 default: 940 dprintf(("Unsupported WM_H/VSCROLL message %x!!", SHORT2FROMMP(os2Msg->mp2))); 930 //PF For win32 we support only vertical scrolling for WM_MOUSEWHEEL 931 if((os2Msg->msg == WM_VSCROLL) && (fMsgRemoved == MSG_REMOVE)) 932 { 933 MSLLHOOKSTRUCT hook; 934 935 //TODO: 936 winMsg->message = WINWM_MOUSEWHEEL; 937 winMsg->lParam = 0; 938 winMsg->wParam = 0; 939 940 hook.pt.x = os2Msg->ptl.x & 0xFFFF; 941 hook.pt.y = mapScreenY(os2Msg->ptl.y); 942 if (SHORT2FROMMP(os2Msg->mp2) == SB_LINEDOWN) 943 hook.mouseData = MAKELONG(0, -WHEEL_DELTA/OS2_WHEEL_CORRECTION); 944 else 945 if (SHORT2FROMMP(os2Msg->mp2) == SB_LINEUP) 946 { 947 hook.mouseData = MAKELONG(0, WHEEL_DELTA/OS2_WHEEL_CORRECTION); 948 } 949 else goto dummymessage; // IBM driver produces other messages as well sometimes 950 951 hook.flags = LLMHF_INJECTED; 952 hook.time = winMsg->time; 953 hook.dwExtraInfo = 0; 954 if(HOOK_CallHooksW( WH_MOUSE_LL, HC_ACTION, WINWM_MOUSEWHEEL, (LPARAM)&hook)) { 955 goto dummymessage; //hook swallowed message 956 } 941 957 goto dummymessage; 942 } 958 } 959 goto dummymessage; //eat this message 960 943 961 break; 944 962
Note:
See TracChangeset
for help on using the changeset viewer.