Changeset 2377 for trunk/src/user32/new/oslibmsgtranslate.cpp
- Timestamp:
- Jan 8, 2000, 5:47:50 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/oslibmsgtranslate.cpp
r2353 r2377 1 /* $Id: oslibmsgtranslate.cpp,v 1. 6 2000-01-07 17:38:47cbratschi Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.7 2000-01-08 16:47:46 cbratschi Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 102 102 //****************************************************************************** 103 103 //****************************************************************************** 104 ULONG GetMouseKeyState() 105 { 106 ULONG keystate; 107 108 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000) 109 keystate |= MK_LBUTTON_W; 110 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2) & 0x8000) 111 keystate |= MK_RBUTTON_W; 112 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3) & 0x8000) 113 keystate |= MK_MBUTTON_W; 114 if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT) & 0x8000) 115 keystate |= MK_SHIFT_W; 116 if(WinGetKeyState(HWND_DESKTOP, VK_CTRL) & 0x8000) 117 keystate |= MK_CONTROL_W; 118 119 return keystate; 120 } 121 //****************************************************************************** 122 //****************************************************************************** 123 LONG IsNCMouseMsg(Win32BaseWindow *win32wnd) 124 { 125 return ((win32wnd->getLastHitTestVal() != HTCLIENT_W) && (WinQueryCapture(HWND_DESKTOP) != win32wnd->getOS2WindowHandle())); 126 } 127 //****************************************************************************** 128 //****************************************************************************** 104 129 BOOL OS2ToWinMsgTranslate(void *pThdb, QMSG *os2Msg, MSG *winMsg, BOOL isUnicode, BOOL fMsgRemoved) 105 130 { … … 141 166 case WM_BUTTON3DBLCLK: 142 167 //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window 143 if (win32wnd->lastHitTestVal != HTCLIENT_W) {168 if (IsNCMouseMsg(win32wnd)) { 144 169 winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN); 145 170 winMsg->wParam = win32wnd->lastHitTestVal; … … 153 178 154 179 winMsg->message = WINWM_LBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN); 180 winMsg->wParam = GetMouseKeyState(); 155 181 winMsg->lParam = MAKELONG(ClientPoint.x, ClientPoint.y); //client coordinates 156 182 } … … 171 197 case WM_MOUSEMOVE: 172 198 { 173 ULONG keystate = 0, setcursormsg = WINWM_MOUSEMOVE;174 175 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000)176 keystate |= MK_LBUTTON_W;177 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2) & 0x8000)178 keystate |= MK_RBUTTON_W;179 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3) & 0x8000)180 keystate |= MK_MBUTTON_W;181 if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT) & 0x8000)182 keystate |= MK_SHIFT_W;183 if(WinGetKeyState(HWND_DESKTOP, VK_CTRL) & 0x8000)184 keystate |= MK_CONTROL_W;185 186 199 //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window 187 if( win32wnd->lastHitTestVal != HTCLIENT_W)188 { 189 setcursormsg= WINWM_NCMOUSEMOVE;190 winMsg->wParam = (WPARAM)win32wnd->lastHitTestVal;191 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y);200 if(IsNCMouseMsg(win32wnd)) 201 { 202 winMsg->message = WINWM_NCMOUSEMOVE; 203 winMsg->wParam = (WPARAM)win32wnd->lastHitTestVal; 204 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y); 192 205 } else 193 206 { 194 winMsg->wParam = (WPARAM)keystate; 207 winMsg->message = WINWM_MOUSEMOVE; 208 winMsg->wParam = GetMouseKeyState(); 195 209 winMsg->lParam = MAKELONG(SHORT1FROMMP(os2Msg->mp1),mapOS2ToWin32Y(win32wnd->getOS2FrameWindowHandle(),win32wnd->getOS2WindowHandle(),SHORT2FROMMP(os2Msg->mp1))); 196 210 } 197 211 //OS/2 Window coordinates -> Win32 Window coordinates 198 winMsg->message = setcursormsg;199 212 return TRUE; 200 213 } … … 332 345 case WM_BUTTON3DBLCLK: 333 346 //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window 334 if( win32wnd->lastHitTestVal != HTCLIENT_W) {347 if(IsNCMouseMsg(win32wnd)) { 335 348 winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN); 336 349 winMsg->wParam = win32wnd->lastHitTestVal; … … 344 357 345 358 winMsg->message = WINWM_LBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN); 359 winMsg->wParam = GetMouseKeyState(); 346 360 winMsg->lParam = MAKELONG(ClientPoint.x, ClientPoint.y); //client coordinates 347 361 } … … 362 376 case WM_MOUSEMOVE: 363 377 { 364 ULONG keystate = 0, setcursormsg = WINWM_MOUSEMOVE;365 366 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON1) & 0x8000)367 keystate |= MK_LBUTTON_W;368 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON2) & 0x8000)369 keystate |= MK_RBUTTON_W;370 if(WinGetKeyState(HWND_DESKTOP, VK_BUTTON3) & 0x8000)371 keystate |= MK_MBUTTON_W;372 if(WinGetKeyState(HWND_DESKTOP, VK_SHIFT) & 0x8000)373 keystate |= MK_SHIFT_W;374 if(WinGetKeyState(HWND_DESKTOP, VK_CTRL) & 0x8000)375 keystate |= MK_CONTROL_W;376 377 378 //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window 378 if( win32wnd->lastHitTestVal != HTCLIENT_W)379 { 380 setcursormsg= WINWM_NCMOUSEMOVE;381 winMsg->wParam = (WPARAM)win32wnd->lastHitTestVal;382 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y);379 if(IsNCMouseMsg(win32wnd)) 380 { 381 winMsg->message = WINWM_NCMOUSEMOVE; 382 winMsg->wParam = (WPARAM)win32wnd->lastHitTestVal; 383 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y); 383 384 } else 384 385 { 385 winMsg->wParam = (WPARAM)keystate; 386 winMsg->message = WINWM_MOUSEMOVE; 387 winMsg->wParam = GetMouseKeyState(); 386 388 winMsg->lParam = MAKELONG(SHORT1FROMMP(os2Msg->mp1),mapY(win32wnd,SHORT2FROMMP(os2Msg->mp1))); 387 389 } 388 390 //OS/2 Window coordinates -> Win32 Window coordinates 389 winMsg->message = setcursormsg;390 391 break; 391 392 }
Note:
See TracChangeset
for help on using the changeset viewer.