Copy and paste standalone on a Mac
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Copy and paste standalone on a Mac
Hi,
I have a standalone app. On a Mac, the command-C function (copy text) doesn't work, yet command-V does. When running under the IDE it works fine
The standalone PC version doesn't work either - also works fine in the IDE
Any ideas on what I am doing wrong appreciated
Cheers
Bergsy
I have a standalone app. On a Mac, the command-C function (copy text) doesn't work, yet command-V does. When running under the IDE it works fine
The standalone PC version doesn't work either - also works fine in the IDE
Any ideas on what I am doing wrong appreciated
Cheers
Bergsy
Re: Copy and paste standalone on a Mac
Seems that by default text fields have the "share text" option turned off. Turning it on solves the problem
Re: Copy and paste standalone on a Mac
Spoke too soon - works on a PC now but not on a Mac. Command-C does nothing
Re: Copy and paste standalone on a Mac
Just to be clear, I am trying to copy test from a text field and paste to a text field
Thanks
Bergsy
Thanks
Bergsy
Re: Copy and paste standalone on a Mac
Hi Bergsy,
maybe that (standalone) stack is password protected?
That will prohibit copying anything FROM that stack.
Best
Klaus
maybe that (standalone) stack is password protected?
That will prohibit copying anything FROM that stack.
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Copy and paste standalone on a Mac
I believe password protection only prohibits the copying objects, since objects can contain protected scripts. Copying text should be fine.
Bergsy, what does your commandKeyDown handler look like?
Bergsy, what does your commandKeyDown handler look like?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Copy and paste standalone on a Mac
Hi Fourthworld,
My commandKeyDown looks like this. I trap Ctrl-F to toggle fullscreen, otherwise I pass it on
on commandkeyDown theKey
if theKey = "f" or theKey = "F" then
put the short name of this stack into tStackName
put the fullscreen of this stack into bFullScreen
if bFullScreen then
--centerMe
set the fullscreen of this stack to not bFullScreen
set the height of this stack to gScreenParameters[tStackName][“height”]
set the width of this stack to gScreenParameters[tStackName][“width”]
set the top of this stack to gScreenParameters[tStackName][“top”]
set the left of this stack to gScreenParameters[tStackName][“left”]
set the loc of this stack to gScreenParameters[tStackName][“loc”]
else
put the height of this stack into gScreenParameters[tStackName][“height”]
put the width of this stack into gScreenParameters[tStackName][“width”]
put the top of this stack into gScreenParameters[tStackName][“top”]
put the left of this stack into gScreenParameters[tStackName][“left”]
put the loc of this stack into gScreenParameters[tStackName][“loc”]
set the fullscreen of this stack to not bFullScreen
end if
else
pass commandKeyDown
end if
end commandkeyDown
Cheers
bergsy
My commandKeyDown looks like this. I trap Ctrl-F to toggle fullscreen, otherwise I pass it on
on commandkeyDown theKey
if theKey = "f" or theKey = "F" then
put the short name of this stack into tStackName
put the fullscreen of this stack into bFullScreen
if bFullScreen then
--centerMe
set the fullscreen of this stack to not bFullScreen
set the height of this stack to gScreenParameters[tStackName][“height”]
set the width of this stack to gScreenParameters[tStackName][“width”]
set the top of this stack to gScreenParameters[tStackName][“top”]
set the left of this stack to gScreenParameters[tStackName][“left”]
set the loc of this stack to gScreenParameters[tStackName][“loc”]
else
put the height of this stack into gScreenParameters[tStackName][“height”]
put the width of this stack into gScreenParameters[tStackName][“width”]
put the top of this stack into gScreenParameters[tStackName][“top”]
put the left of this stack into gScreenParameters[tStackName][“left”]
put the loc of this stack into gScreenParameters[tStackName][“loc”]
set the fullscreen of this stack to not bFullScreen
end if
else
pass commandKeyDown
end if
end commandkeyDown
Cheers
bergsy
-
- VIP Livecode Opensource Backer
- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Copy and paste standalone on a Mac
If you want to handle copy and paste you'll probably want to add those to your handler. A switch block can make that clean and easy, e.g.:
Code: Select all
on commandKeyDown k
switch k
case "c"
copy
break
case "v"
paste
break
case "f"
-- fullscreen stuff goes here
break
default
pass commandKeyDown
end switch
end commandKeyDown
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Copy and paste standalone on a Mac
That did the trick Richard - thanks a heap
Wouldn't Livecode be better off implementing this as a basic feature, allowing people to turn it off if they don't want it? Particularly since it works under the IDE
Anyway, I really appreciate the help
Cheers
Bergsy
Wouldn't Livecode be better off implementing this as a basic feature, allowing people to turn it off if they don't want it? Particularly since it works under the IDE
Anyway, I really appreciate the help
Cheers
Bergsy
-
- VIP Livecode Opensource Backer
- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Copy and paste standalone on a Mac
It might seem basic, but LiveCode is used to make so many different kinds of apps that what needs to happen in response to command keys may not be as simple for others as it was for yours.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Copy and paste standalone on a Mac
Hi,
This solution works well, however I also want to implement Ctrl-A to select all text. Is there an equivalent command as there is for copy and paste?
Thanks for the help
Cheers
Greg
This solution works well, however I also want to implement Ctrl-A to select all text. Is there an equivalent command as there is for copy and paste?
Thanks for the help
Cheers
Greg
Re: Copy and paste standalone on a Mac
Add a case to the switch:
Code: Select all
case "A"
if the selectedField is not empty then select the text of the selectedField
break
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Copy and paste standalone on a Mac
Thanks Jacque. Sorry for the delay - travelling
The Mac keysequences keep catching me out. "Shift-del" needs to backspace a character, the same as "delete". So I need to handle this as well
I will post this as a separate issues, so no need to reply here
The Mac keysequences keep catching me out. "Shift-del" needs to backspace a character, the same as "delete". So I need to handle this as well
I will post this as a separate issues, so no need to reply here