void Ctrl::DoMouseFB(int event, Point p, int zdelta, CParser& cp) { ReadKeyMods(cp); MousePos = p; int a = event & ACTION; if(a == UP && Ctrl::ignoreclick) { EndIgnore(); return; } else if(a == DOWN && ignoreclick) return; LLOG("### Mouse event: " << event << " position " << p << " zdelta " << zdelta << ", capture " << Upp::Name(captureCtrl)); if(captureCtrl) MouseEventFB(captureCtrl->GetTopCtrl(), event, p, zdelta); else for(int i = topctrl.GetCount() - 1; i >= 0; i--) { Ptr<Ctrl> t = topctrl[i]; Rect rr = t->GetRect(); if(rr.Contains(p)) { MouseEventFB(t, event, p, zdelta); return; } } Ctrl *desktop = GetDesktop(); if(desktop) { desktop->DispatchMouse(event, p, zdelta); desktop->PostInput(); } }
bool Ctrl::DoKeyFB(dword key, int cnt) { LLOG("DoKeyFB [" << GetKeyDesc(key) << "] " << key << ", " << cnt); bool b = DispatchKey(key, cnt); SyncCaret(); Ctrl *desktop = GetDesktop(); if(desktop) desktop->PostInput(); return b; }