mojira.dev

Do or do not

Assigned

No issues.

Reported

No issues.

Comments

Can confirm in 1.17.1 and 21w37a.

@Till Kraemer

You're welcome! 😃

I wrote a small Python script to keep the mouse away from the edges of the screen.

First (assuming you have Python installed), install some Python modules using the Windows command prompt:

pip install pywin32
pip install keyboard

Then, run the following Python script (press DELETE to stop):

 

import win32api,win32con
import keyboard
ScreenSize_x = win32api.GetSystemMetrics(0)
ScreenSize_y = win32api.GetSystemMetrics(1)
Center_x = ScreenSize_x//2
Center_y = ScreenSize_y//2
while not keyboard.is_pressed('Delete'):
    Mouse_x, Mouse_y = win32api.GetCursorPos()
    if Mouse_x < 50 or Mouse_x > ScreenSize_x - 50 or Mouse_y < 50 or Mouse_y > ScreenSize_y - 50:
        win32api.SetCursorPos((Center_x, Center_y))

Now, whenever the cursor comes close to one of the edges of the screen, its position is set to the screen's center.