+ if (GetEventHandler()->ProcessEvent(event))
+ return TRUE;
+ else
+ return FALSE;
+ }
+ else
+ return FALSE;
+}
+
+bool wxWindow::MSWOnKeyDown(WXWORD wParam, WXLPARAM lParam)
+{
+ int id;
+
+ if ((id = wxCharCodeMSWToWX(wParam)) == 0) {
+ id = wParam;
+ }
+
+ if (id != -1)
+ {
+ wxKeyEvent event(wxEVT_KEY_DOWN);
+ event.m_shiftDown = (::GetKeyState(VK_SHIFT)&0x100?TRUE:FALSE);
+ event.m_controlDown = (::GetKeyState(VK_CONTROL)&0x100?TRUE:FALSE);
+ if ((HIWORD(lParam) & KF_ALTDOWN) == KF_ALTDOWN)
+ event.m_altDown = TRUE;
+
+ event.m_eventObject = this;
+ event.m_keyCode = id;
+ event.SetTimestamp(wxApp::sm_lastMessageTime);
+
+ POINT pt ;
+ GetCursorPos(&pt) ;
+ RECT rect ;
+ GetWindowRect((HWND) GetHWND(),&rect) ;
+ pt.x -= rect.left ;
+ pt.y -= rect.top ;
+
+ event.m_x = pt.x; event.m_y = pt.y;
+
+ if (GetEventHandler()->ProcessEvent(event))
+ {
+ return TRUE;
+ }
+ else return FALSE;
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
+bool wxWindow::MSWOnKeyUp(WXWORD wParam, WXLPARAM lParam)
+{
+ int id;
+
+ if ((id = wxCharCodeMSWToWX(wParam)) == 0) {
+ id = wParam;
+ }
+
+ if (id != -1)
+ {
+ wxKeyEvent event(wxEVT_KEY_UP);
+ event.m_shiftDown = (::GetKeyState(VK_SHIFT)&0x100?TRUE:FALSE);
+ event.m_controlDown = (::GetKeyState(VK_CONTROL)&0x100?TRUE:FALSE);
+ if ((HIWORD(lParam) & KF_ALTDOWN) == KF_ALTDOWN)
+ event.m_altDown = TRUE;
+
+ event.m_eventObject = this;
+ event.m_keyCode = id;
+ event.SetTimestamp(wxApp::sm_lastMessageTime);
+
+ POINT pt ;
+ GetCursorPos(&pt) ;
+ RECT rect ;
+ GetWindowRect((HWND) GetHWND(),&rect) ;
+ pt.x -= rect.left ;
+ pt.y -= rect.top ;
+
+ event.m_x = pt.x; event.m_y = pt.y;
+
+ if (GetEventHandler()->ProcessEvent(event))
+ return TRUE;
+ else
+ return FALSE;