void ButtonEvent(DWORD dwEvent, LPARAM lParam) { #ifndef SHADOW_BROODWAR BYTE bFlag = 0; switch( dwEvent ) { case BW_EVN_LBUTTONDOWN: case BW_EVN_LBUTTONUP: case BW_EVN_LBUTTONDBLCLK: bFlag = 0x02; break; case BW_EVN_RBUTTONDOWN: case BW_EVN_RBUTTONUP: case BW_EVN_RBUTTONDBLCLK: bFlag = 0x08; break; case BW_EVN_MBUTTONDOWN: case BW_EVN_MBUTTONUP: case BW_EVN_MBUTTONDBLCLK: bFlag = 0x20; break; } if ( !( BW::BWDATA::InputFlags & ~bFlag & 0x2A) ) { switch( dwEvent ) { case BW_EVN_LBUTTONDOWN: case BW_EVN_RBUTTONDOWN: case BW_EVN_MBUTTONDOWN: case BW_EVN_LBUTTONDBLCLK: case BW_EVN_RBUTTONDBLCLK: case BW_EVN_MBUTTONDBLCLK: BW::BWDATA::InputFlags |= bFlag; SetCapture(ghMainWnd); break; case BW_EVN_LBUTTONUP: case BW_EVN_RBUTTONUP: case BW_EVN_MBUTTONUP: BW::BWDATA::InputFlags &= ~bFlag; ReleaseCapture(); break; } POINTS pt = MAKEPOINTS(lParam); BW::dlgEvent evt = { 0 }; evt.wNo = (WORD)dwEvent; evt.cursor.x = pt.x; evt.cursor.y = pt.y; BW::BWDATA::Mouse.x = pt.x; BW::BWDATA::Mouse.y = pt.y; if ( !SendHotkey(&evt) && BW::BWDATA::InputProcedures[dwEvent] ) BW::BWDATA::InputProcedures[dwEvent](&evt); } #endif }
void SceneInfo::SwitchScene(SceneInfo *previousScene) { if (Hotkeys.isEmpty()) { return; } PreviousScene = previousScene; if (Delay > 0) { timer->start(Delay*1000); } else { SendHotkey(); } }
void SceneInfo::TimerExpired() { qInfo() << "Timeout"; SendHotkey(); }