Moving the mouse pointer in C++ fails on Linux
问题 I'm using the following code to hide and show the mouse cursor: XDefineCursor( m_display, m_window, show ? None : m_hiddenCursor ); XFlush( m_display ); That works fine. However, when I run this: XWarpPointer( m_display, None, m_window, 0, 0, 0, 0, x, y ); XFlush( m_display ); The mouse doesn't move at all. Simply nothing happens. SetMousePos, which I'm using for Windows, works fine. 回答1: It's been a while, but doesn't XWarpPointer make a relative move of the cursor using the passed offsets?