Input and copypaste

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
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Input and copypaste

#1 Post by trooper6 »

Hi All! I have a question about the copypaste property.

So in the documentation it notes that the Input Screen Interface Statement can take the property "copypaste." The documentation says:
copypaste: If True, it becomes possible to copy and paste into this input. (By default, disabled.)
https://www.renpy.org/doc/html/screens. ... aste#input

I wanted to test this out and wrote out this code:

Code: Select all

default plaintext = ""

screen inputTest():
    frame:
        has vbox
        minimum (500, 100)
        input:
            value VariableInputValue("plaintext")
            allow "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYXZ "
            copypaste True
        text "-----"
        text plaintext

label start():
    show screen inputTest()
    "I'm testing the copypaste function."
    "How's it going?"
    "Done!"

    return
Running this there is no copying or pasting at all. So...I looked into the changelog, copypaste is introduced in 7.2.0...so it isn't that old.
https://www.renpy.org/doc/html/changelo ... paste#id21

The info on it is interesting, it says:
The input displayable now takes a new copypaste property, which when true allows copying with ctrl+C and pasting with ctrl+V. This is enabled in the console and launcher.
Okay...do I need to do something special to enable it? But I don't see any options to do so in the launcher. Being able to get this copypaste property to work would be very nice. Any ideas?
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
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Input and copypaste

#2 Post by Alex »

Looks like it works fine, but you unable to highlight the part of this text. Try to hit ctrl+c, then move caret some characters to the left, and hit ctrl+v.

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

Re: Input and copypaste

#3 Post by trooper6 »

Alex wrote: Sun Apr 05, 2020 3:23 pm Looks like it works fine, but you unable to highlight the part of this text. Try to hit ctrl+c, then move caret some characters to the left, and hit ctrl+v.
I can't highlight anything and neither ctrl-c nor ctrl-v are doing anything....no error messages...just...nothing. What am I not doing that I should be doing?
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
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Input and copypaste

#4 Post by Imperf3kt »

Maybe it's buggy on Mac only. Does anybody else have a mac to test this with and see if it's Macs in general, or just Trooper6
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

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

Re: Input and copypaste

#5 Post by trooper6 »

So! I did some more poking around and I learned some things!
On Mac we normally use Cmd-C and Cmd-V for copypaste...and that doesn't work in Renpy's copypaste.
So I tried this with the actual Ctrl-C and Ctrl-V...but I ran into a problem.
Ctrl is what triggers skipping. So...I'd immediately skip out of my program when I tried to hold down the control key. Making the screen modal "fixed" that...in that the program didn't actually skip...but the skipping indicator still showed in the upper left of the screen. So...I just turned off skipping for the period the screen with inputs was up...and that did seem to fix it.
Also, text isn't highlit so there is no visual feedback for the user...which I'd like to fix somehow. Maybe my seeing what the Ren'Py Core does to have the skipping indicator show up when the player presses ctrl?

ETA: I note this section of the the documentation on Modifying the Keymap:
ctrl
Matches if the Ctrl key is pressed. Keysyms without this prefix match when the Ctrl key is not pressed. (Ctrl is not very useful, as it usually triggers skipping.)
It seems like there is a bit of a conflict having cntrl be both skipping as well as copying and pasting.
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
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Input and copypaste

#6 Post by Alex »

Just a thoughts, instead of setting 'modal' property, you could try to turn off skipping in this screen, like

Code: Select all

key 'skip' action NullAction()
or customize the keymap for copy/paste (input_copy / input_paste) - https://www.renpy.org/doc/html/keymap.html#keymap

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

Re: Input and copypaste

#7 Post by trooper6 »

I'd already tried the key action. It doesn't actually stop skipping. Adding modal true to the screen will stop the game from skipping...but the skipping indicator still shows up...so I think the game is still registering skipping.

Anyhow, I found a way to deal with it.
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
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Input and copypaste

#8 Post by Imperf3kt »

The skipping indicator only shows up if renpy.is_skipping() is True, try setting it False?

https://www.renpy.org/doc/html/other.ht ... s_skipping

Or just edit the skip screen maybe. It's one of the common files, so you can override it.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Google [Bot]