if ( !bCtrlDown )
{
// this will contain the dialog code of this
- // window and all of its parent windows
+ // window and all of its parent windows in turn
LONG lDlgCode2 = lDlgCode;
- while ( win && !win->IsTopLevel() )
+ while ( win )
{
if ( lDlgCode2 & DLGC_WANTMESSAGE )
{
return false;
}
+ // don't propagate keyboard messages beyond
+ // the first top level window parent
+ if ( win->IsTopLevel() )
+ break;
+
+ win = win->GetParent();
+
lDlgCode2 = ::SendMessage
(
GetHwndOf(win),
0,
0
);
-
- win = win->GetParent();
}
}
else // bCtrlDown
event.m_aux1Down = (flags & MK_XBUTTON1) != 0;
event.m_aux2Down = (flags & MK_XBUTTON2) != 0;
#endif // wxHAS_XBUTTON
- event.m_altDown = ::GetKeyState(VK_MENU) < 0;
+ event.m_altDown = ::wxIsAltDown();
#ifndef __WXWINCE__
event.SetTimestamp(::GetMessageTime());
ms.SetAux2Down(wxIsKeyDown(VK_XBUTTON2));
#endif // wxHAS_XBUTTON
- ms.SetControlDown(wxIsKeyDown(VK_CONTROL));
- ms.SetShiftDown(wxIsKeyDown(VK_SHIFT));
- ms.SetAltDown(wxIsKeyDown(VK_MENU));
+ ms.SetControlDown(wxIsCtrlDown ());
+ ms.SetShiftDown (wxIsShiftDown());
+ ms.SetAltDown (wxIsAltDown ());
// ms.SetMetaDown();
return ms;