Auto-Forcing the cursor to move to lower corner

July 27, 2024, 22:11

h_0_p

I have a project that runs a python script when the pi boots up. When it boots, it checks how many days left until Halloween, and displays an image on the screen to reflect how many days left. It also spins 2 stepper motors ...This part works. The issue I am having is the cursor is displayed right smack in the middle of the screen, and I need it moved out of the way. This is going to run on its own with no mouse/kb installed. I've tried using the following methods:
python
pyautogui
  - attempt to move the cursor using pyautogui.moveTo(screen_width - 1, screen_height - 1)
xdotool via subprocess
  - subprocess.run(["xdotool", "mousemove", str(screen_width - 1), str(screen_height - 1)])
  - also tried to execute xdtool before initializing pygame:
      subprocess.run(["xdotool", "mousemove", "1919", "719"])
pynput
  - mouse.position = (screen_width - 1, screen_height - 1)
evdev
  - ui.write(e.EV_REL, e.REL_X, screen_width - 1)
    ui.write(e.EV_REL, e.REL_Y, screen_height - 1)
    ui.syn()
Nothing seems to make the cursor move out of the way - I am trying to move it to the lower right of the screen where it will be hidden. Any input is greatly appreciated.

h_0_p

Source Code:

h_0_p

various places I've read online, people use the pyautogui function.. but it isn't moving my cursor

ihatenetworkchuck

hmmm

ihatenetworkchuck

yeah

ihatenetworkchuck

its the first thing i thought about

ihatenetworkchuck

when you use X you can just use xdotool

ihatenetworkchuck

if it doesnt work then i cannot help more than that, i'd prob be stuck in the same place xd

h_0_p

seems nothing works. I don't get it

h_0_p

That little bastard right there

h_0_p

just wish it would hide or move or something

ihatenetworkchuck

ye yee

ihatenetworkchuck

there was a thing

ihatenetworkchuck

to autohide pointer

ihatenetworkchuck

look in this direction

ihatenetworkchuck

smth like this

h_0_p

someone on a fb group mentioned trying hiding it with unicurses

ihatenetworkchuck

ooooooo

ihatenetworkchuck

i used unclutter

h_0_p

or maybe pygame's mouse.set_visible

ihatenetworkchuck

it runs as a daemon try this

h_0_p

ah hah! pygame.mouse.set_visible(False) works!

ihatenetworkchuck

nice

ihatenetworkchuck

project done

h_0_p

yes, for now. At least all the programming is done. I just need to build everything now to stuff the electronics into 😄

tolek3.0

May I know what project you're doing rn?

tolek3.0

My grammar sucks sorry bout that

tolek3.0

(Just curious)

h_0_p

It is a Halloween prop. It’s the clock from the nightmare before Christmas.