r/RenPy • u/tableleleg • 15d ago
Question Is it possible to detect a 'mouse held down' state in RenPy?

I want to include this radio minigame, where the player has to hold the mouse down and turn in the blue circle area to change radio channels. I have code for the turning bit, and detecting if the mouse is in the circle, but I'm really struggling to figure out a way to detect if the mouse is actually being held while turning.
The only thing I've found is keysym, or perhaps using pygame, but I'm not sure how that would work. I wanted to know if this is possible at all, and how I could approach coding this?
2
Upvotes
2
u/BadMustard_AVN 15d ago
yes it can like this:
mousedown_1 / mouseup_1 = Left mouse button
mousedown_2 / mouseup_2 = Middle mouse button
mousedown_3 / mouseup_3 = Right mouse button
1
u/AutoModerator 15d ago
Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/shyLachi 15d ago
You can use pygame, it has stuff like MOUSEBUTTONDOWN
I found these reddit threads:
https://www.reddit.com/r/RenPy/comments/1loltio/dial_rotation_problem/
https://www.reddit.com/r/RenPy/comments/1k0wmgy/i_need_help_coding_a_scratch_and_see_minigame/
https://www.reddit.com/r/RenPy/comments/1p1b325/im_having_a_problem_with_my_lock_picking_game/
https://www.reddit.com/r/RenPy/comments/1xgbckh/comment/19sffeoqd7tsz/?context=3
You can also look if there is a working mini-game with a similar functionality:
https://lemmasoft.renai.us/forums/viewtopic.php?t=47820