| 492 | _block_keyboard = enable; |
| 493 | } |
| 494 | void 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 | |
| 512 | bool reshade::input::is_blocking_any_mouse_input(window_handle target) |
| 513 | { |