记录光标在每个屏幕中最后停留的位置

This commit is contained in:
2025-09-02 16:27:45 +08:00
parent 6719ccca2b
commit ac91ebbed3
8 changed files with 75 additions and 16 deletions

View File

@@ -337,6 +337,11 @@ bool get_pointer_position(int32_t *x, int32_t *y) {
return false;
}
void set_pointer_position(int32_t x, int32_t y) {
xcb_warp_pointer(conn, XCB_WINDOW_NONE, screen->root, 0, 0, 1, 1, x, y);
xcb_flush(conn);
}
bool xcb_check_mask_event(xcb_event_mask_t event_mask) {
xcb_generic_event_t *event = xcb_poll_for_event(conn);
if (!event) return false;