Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions code/components/glue/src/GtaNui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,11 @@ static InitFunction initFunction([]()
#endif

nuiGi.UpdateMouseFocus();

#ifdef GTA_FIVE
// NUI forwards WM_MOUSEMOVE/WM_*BUTTON* to CEF, also with SetNuiFocusKeepInput
InputHook::SetLegacyMouseRequired(nui::HasFocus() || nui::HasCursor());
#endif
}, -1000);

rage::fiDevice::OnInitialMount.Connect([]()
Expand Down
3 changes: 3 additions & 0 deletions code/components/rage-input-five/include/InputHook.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ extern INPUT_DECL fwEvent<int&> QueryMayLockCursor;

INPUT_DECL void SetGameMouseFocus(bool focus, bool flushMouse = true);

// set while a UI (e.g. NUI with SetNuiFocusKeepInput) needs legacy mouse messages
INPUT_DECL void SetLegacyMouseRequired(bool required);

INPUT_DECL void EnableSetCursorPos(bool enabled);

INPUT_DECL bool IsMouseButtonDown(int buttonFlag);
Expand Down
Loading
Loading