Disable mouse during movie?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
User avatar
ktalkimist
Veteran
Posts: 216
Joined: Fri Oct 19, 2012 10:28 pm
Contact:

Disable mouse during movie?

#1 Post by ktalkimist » Wed Jul 24, 2013 5:55 am

Hi guys,

Just a quick question. How do I disable mouse inputs during movie playback? I want only the ESC button to skip the movie and prevent rollback.

Thanks!

User avatar
Alex
Lemma-Class Veteran
Posts: 2217
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Disable mouse during movie?

#2 Post by Alex » Wed Jul 24, 2013 12:09 pm

Ren'Py can be operated by mouse and by keys too. So, one can make a screen that will re-set the actions for keys and mouse buttons if shown. Like

Code: Select all

screen my_scr:
    key "K_RETURN" action Hide("nonexistent_screen")
    key "K_KP_ENTER" action Hide("nonexistent_screen")
    key "K_SPACE" action Hide("nonexistent_screen")
    
    key "mousedown_4" action Hide("nonexistent_screen")
    key "K_PAGEUP" action Hide("nonexistent_screen")
    key "mousedown_5" action Hide("nonexistent_screen")
    key "K_PAGEDOWN" action Hide("nonexistent_screen")
    
    key "mouseup_3" action Hide("nonexistent_screen")
    key "mouseup_1" action Hide("nonexistent_screen")

    key "K_ESCAPE" action Return("smth")


label start:
    "Everything works like it suppose to be..."
    "And now, you'll see the movie that you'll be unable to skip (exept esc-key)"
    show screen my_scr
    # show movie here
    hide screen my_scr
http://www.renpy.org/wiki/renpy/doc/reference/Keymap
http://www.pygame.org/docs/ref/key.html
http://www.renpy.org/doc/html/screens.html
http://www.renpy.org/doc/html/screens.html#key
Last edited by Alex on Thu Jul 25, 2013 1:44 pm, edited 1 time in total.

User avatar
AlfieMachica123
Regular
Posts: 56
Joined: Sun Jun 30, 2013 10:15 pm
Contact:

Re: Disable mouse during movie?

#3 Post by AlfieMachica123 » Wed Jul 24, 2013 5:15 pm

thanks for the tip , i can use this but,
what about the left click for the mouse?

thanks

User avatar
trooper6
Lemma-Class Veteran
Posts: 3574
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Disable mouse during movie?

#4 Post by trooper6 » Wed Jul 24, 2013 8:12 pm

AlfieMachica123 wrote:thanks for the tip , i can use this but,
what about the left click for the mouse?
The left click of the mouse is covered in Alex's code. It is the mousedown_1 code up there.
I can't find where the specific numbers are explained but:

mousebutton 1 = left click
mousebutton 2 = center button click
mousebutton 3 = right click
mousebutton 4 = mouse wheel up
mousebutton 5 = mouse wheel down
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
AlfieMachica123
Regular
Posts: 56
Joined: Sun Jun 30, 2013 10:15 pm
Contact:

Re: Disable mouse during movie?

#5 Post by AlfieMachica123 » Thu Jul 25, 2013 3:42 am

am sorry , but the mouse input left and right click still works,

i used the code he gave like this

label start:
"Everything works like it suppose to be..."
"And now, you'll see the movie that you'll be unable to skip (exept esc-key)"
show screen my_scr ## starting here should not work
"eff-er" "effidee eff eff eff" ## left and right still works here
hide screen my_scr ## this should bring back the controls, right ?
"what the heck happened" ##
return

and there.. :P

User avatar
Alex
Lemma-Class Veteran
Posts: 2217
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Disable mouse during movie?

#6 Post by Alex » Thu Jul 25, 2013 1:45 pm

Ooops... should be

Code: Select all

    key "mouseup_3" action Hide("nonexistent_screen")
    key "mouseup_1" action Hide("nonexistent_screen")

User avatar
AlfieMachica123
Regular
Posts: 56
Joined: Sun Jun 30, 2013 10:15 pm
Contact:

Re: Disable mouse during movie?

#7 Post by AlfieMachica123 » Mon Jul 29, 2013 10:36 pm

it works now, thanks a lot :D

Post Reply

Who is online

Users browsing this forum: Google [Bot]