Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
from ctypes import *
user32 = windll.user32
Then somewhere in the body of the script, add:
mouselock = False
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)
Here, the M key is the toggle, but you could set it to any key. There are other third party apps that hide the cursor. This just locks it to the edge of your screen. Sometimes a pain to pause and then restart a race. Hope this helps.