Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from ctypes import *
- user32 = windll.user32
- if starting:
- mouselock = False # for assetto corsa
- toggle_mouselock = keyboard.getPressed(Key.M) # assign toggle key. if want to assign on mouse, use "mouse.getPressed(2)" instead, 2=middle button, 0=left and 1=right
- if toggle_mouselock:
- mouselock = not mouselock
- if (mouselock):
- user32.SetCursorPos(0, 5000) # lock mouse at left-bottom of screen (x y pixel coordinates)
- # note: line number 1,2,12 are core codes. however setup a toggle is required to free and lock mouse.
Add Comment
Please, Sign In to add comment