Fix position for wxKeyEvents in wxMSW.
Use ScreenToClient() instead of painstakingly (and incorrectly) transforming the position in this function itself. Closes #12024. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64286 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -5619,20 +5619,10 @@ wxKeyEvent wxWindowMSW::CreateKeyEvent(wxEventType evType,
|
||||
event.SetTimestamp(::GetMessageTime());
|
||||
#endif
|
||||
|
||||
// translate the position to client coords
|
||||
POINT pt;
|
||||
#ifdef __WXWINCE__
|
||||
GetCursorPosWinCE(&pt);
|
||||
#else
|
||||
GetCursorPos(&pt);
|
||||
#endif
|
||||
RECT rect;
|
||||
GetWindowRect(GetHwnd(),&rect);
|
||||
pt.x -= rect.left;
|
||||
pt.y -= rect.top;
|
||||
|
||||
event.m_x = pt.x;
|
||||
event.m_y = pt.y;
|
||||
// translate the position to client coordinates
|
||||
const wxPoint mousePos = ScreenToClient(wxGetMousePosition());
|
||||
event.m_x = mousePos.x;
|
||||
event.m_y = mousePos.y;
|
||||
|
||||
return event;
|
||||
}
|
||||
|
Reference in New Issue
Block a user