rodecomp/Source/Client/Browser/BrowserInputHandoff.cpp
ragnarok-clanker a47d20f8be Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.

Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
2026-10-25 07:42:41 +00:00

37 lines
1 KiB
C++

#include "Client/Application/ApplicationActivation.h"
#include "Client/Browser/BrowserInputHandoff.h"
#include "Client/Input/Mouse.h"
#include "Contents/Configuration/ServiceOptions.h"
// OFFSET: 0x00AB2720
// FUNCTION: fn_45433
void BrowserInputHandoff::Enter() {
if (this->service.Get(ServiceOption::ConfineCursor) == 0) {
return;
}
POINT position{this->mouse.x, this->mouse.y};
this->service.Set(ServiceOption::ConfineCursor, 0);
this->mouse.SetX(position.x);
this->mouse.SetY(position.y);
this->restoreOption = 1;
ClientToScreen(this->applicationWindow, &position);
SetCursorPos(position.x, position.y);
}
// OFFSET: 0x00AB3350
// FUNCTION: fn_45440
void BrowserInputHandoff::Restore() {
if (this->restoreOption == 0) {
return;
}
POINT position;
GetCursorPos(&position);
ScreenToClient(this->applicationWindow, &position);
this->service.Set(ServiceOption::ConfineCursor, 1);
this->mouse.SetX(position.x);
this->mouse.SetY(position.y);
SetActiveWindow(this->applicationWindow);
this->activation.Set(1);
}