I would like the mouse cursor to disappear when I touch any button on a Gamepad.
Also, if I touch the mouse after that, I want the mouse cursor to appear again.
I haven't found a simple way to do this that doesn't require an extensive amount of code on my part.
Does anyone have a simple way to do this?
[Solved] Hide Mouse Cursor When Using Gamepad
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
- SypherZent
- Veteran
- Posts: 362
- Joined: Fri Sep 02, 2016 3:14 am
- Completed: Multiverse Heroes, Space Hamster in Turmoil
- Location: Puerto Rico
- Contact:
[Solved] Hide Mouse Cursor When Using Gamepad
Last edited by SypherZent on Mon Dec 11, 2023 9:40 pm, edited 1 time in total.
- m_from_space
- Eileen-Class Veteran
- Posts: 1012
- Joined: Sun Feb 21, 2021 3:36 am
- Contact:
Re: Hide Mouse Cursor When Using Gamepad
I would create an invisible screen with two states:
1. When the mouse is shown, wait for a gamepad event to fire using the key keyword of the screen, then hide the mouse
2. When the mouse is hidden, check for mouse movement every second or so with a repeating timer and then show it. You can use renpy.get_mouse_pos() and compare it to the last mouse position. Of course you could also just check for normal mouse events instead of movement if that's sufficient.
1. When the mouse is shown, wait for a gamepad event to fire using the key keyword of the screen, then hide the mouse
2. When the mouse is hidden, check for mouse movement every second or so with a repeating timer and then show it. You can use renpy.get_mouse_pos() and compare it to the last mouse position. Of course you could also just check for normal mouse events instead of movement if that's sufficient.
- SypherZent
- Veteran
- Posts: 362
- Joined: Fri Sep 02, 2016 3:14 am
- Completed: Multiverse Heroes, Space Hamster in Turmoil
- Location: Puerto Rico
- Contact:
Re: Hide Mouse Cursor When Using Gamepad
Thanks for the input, m_from_space!
I thought of this, but the game is Point & Click and I didn't want to add a perpetual timer.
Honestly, was hoping for a more elegant solution.
In the end, I simply decided to take advantage of define config.mouse_hide_time, and lowered the value for it.
I thought of this, but the game is Point & Click and I didn't want to add a perpetual timer.
Honestly, was hoping for a more elegant solution.
In the end, I simply decided to take advantage of define config.mouse_hide_time, and lowered the value for it.
Who is online
Users browsing this forum: Google [Bot], Lacha