MCPcopy Create free account
hub / github.com/crosire/reshade / block_mouse_cursor_warping

Method block_mouse_cursor_warping

source/input.cpp:494–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492 _block_keyboard = enable;
493}
494void reshade::input::block_mouse_cursor_warping(bool enable)
495{
496 static const auto ClipCursor_trampoline = reshade::hooks::is_hooked(ClipCursor) ? reshade::hooks::call(HookClipCursor, ClipCursor) : ClipCursor;
497
498 // Some games setup ClipCursor with a tiny area which could make the cursor stay in that area instead of the whole window
499 if (enable)
500 {
501 ClipCursor_trampoline(nullptr);
502 }
503 else if (_block_cursor_warping && (s_last_clip_cursor.right - s_last_clip_cursor.left) != 0 && (s_last_clip_cursor.bottom - s_last_clip_cursor.top) != 0)
504 {
505 // Restore previous clipping rectangle when not blocking mouse input
506 ClipCursor_trampoline(&s_last_clip_cursor);
507 }
508
509 _block_cursor_warping = enable;
510}
511
512bool reshade::input::is_blocking_any_mouse_input(window_handle target)
513{

Callers 1

draw_guiMethod · 0.80

Calls 1

callFunction · 0.85

Tested by

no test coverage detected