-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
I would like to make the mouse pointer/cursor move independently and directly to the given x and y positions without the need to use the relative attributes (REL_X, REL_Y) seen that these two ones make the mouse movement using as reference the actual x and y positions. I wrote this script below to try make the mouse pointer goes directly but nothing happens.
import uinput
from time import sleep
def createDevice():
device = uinput.Device([
uinput.ABS_X,
uinput.ABS_Y,
uinput.BTN_LEFT,
uinput.BTN_RIGHT,
])
return device
def emitActions(device):
sleep(1)
device.emit(uinput.ABS_X, 26, syn=False)
sleep(1)
device.emit(uinput.ABS_Y, 665, syn=False)
sleep(1)
device.syn()
sleep(1)
device.emit(uinput.BTN_LEFT, 1)
sleep(1)
device.emit(uinput.BTN_LEFT, 0)
def main():
dev = createDevice()
emitActions(dev)
if __name__ == "__main__":
main()
When I debugged this code I didn't get errors, but I would like to know what's missing there in this code to make that the mouse pointer goes to the desired x and y positions?
Metadata
Metadata
Assignees
Labels
No labels