/** BroadCast Key Press Event */ void EventMgr::KeyPress(unsigned char Key, unsigned short Mod) { if (last_win_focused == NULL) return; Control *ctrl = last_win_focused->GetFocus(); if (ctrl == NULL) return; ctrl->OnKeyPress( Key, Mod ); }
/** BroadCast Key Press Event */ void EventMgr::KeyPress(unsigned char Key, unsigned short Mod) { if (last_win_focused == NULL) return; Control *ctrl = last_win_focused->GetFocus(); if (!ctrl || !ctrl->OnKeyPress( Key, Mod )) { // FIXME: need a better way to determine when to call ResolveKey/SetHotKey if (core->GetGameControl() && !MButtons // checking for drag actions && !core->IsPresentingModalWindow() && !core->InCutSceneMode() && !core->GetKeyMap()->ResolveKey(Key, 0)) { core->GetGame()->SetHotKey(toupper(Key)); } //this is to refresh changing mouse cursors should the focus change) FakeMouseMove(); } }