Page 1 of 1

Copy Command

Posted: Thu Apr 19, 2012 6:04 pm
by Camewel
Hey, I was wondering, is there was any way to make a LÖVE app put a string in the clipboard? I was looking in the wiki and I can't find anything in there about it, but I don't know what it would be under anyway. It would just be nice for a feature I was planning on.

Re: Copy Command

Posted: Thu Apr 19, 2012 7:18 pm
by Nixola
No, it's not possible yet

Re: Copy Command

Posted: Fri Apr 20, 2012 1:47 am
by Jasoco
I think it would be nice if this were implemented. It could be useful to keep the game feeling like a native app. Minecraft took forever to have this feature implemented so you could paste IP addresses into the server screen. Or seeds to create worlds. Simple commands for saving a string to the clipboard and retrieving it from it would be nice. And if possible, maybe more advanced feature like detecting if it's image data and being able to paste it into imageData or save an image, quad or imageData to the clipboard would be pretty cool.

Unless it would be insecure. But as long as Löve has complete control the whole time it should be fine.

Re: Copy Command

Posted: Fri Apr 20, 2012 5:55 am
by bartbes
Except it's extremely hard for us to implement this at the time of writing.

Re: Copy Command

Posted: Fri Apr 20, 2012 12:10 pm
by Jasoco
Doesn't the language Löve is written in for each OS have native OS commands to retrieve/send data from/to the clipboard? It's pretty standard stuff I would think.

Re: Copy Command

Posted: Fri Apr 20, 2012 12:41 pm
by Adamantos
I think, that you can access the system's clipboard by calling some commandline tools.
There is a way to do this by some native system commands under Linux / OSX:

XSEL under Linux
PBCOPY under OSX

Re: Copy Command

Posted: Fri Apr 20, 2012 12:59 pm
by bartbes
Jasoco wrote:Doesn't the language Löve is written in for each OS have native OS commands to retrieve/send data from/to the clipboard? It's pretty standard stuff I would think.
They differ for each platform and would require pretty low-level stuff to get the needed info out of SDL too, basically, it's a whole lot of hassle for something that can break at any time.

Re: Copy Command

Posted: Fri Apr 20, 2012 8:31 pm
by Jasoco
Fair enough. It's not a huge bother. More of a convenience feature really.