copy-paste not working in a standalone

Peter Haworth pete at lcsql.com
Sat Jul 14 21:15:03 EDT 2012


Hi Jacque,
I'm not 100% sure but I don't think he has a menu script right now.

Your handler works fine of course.  However, when I tried that simplistic
approach in my SQLiteAdmin program, it was politely pointed out to me by a
customer that the availability of cut/copy/paste/clear commands should be
dependant on the cursor being in a control where they make sense.

In my case, only text was involved but I ended up adding code that detected
whether the current control was a field or not and enabling/disabling the
controls appropriately.  Oh yes, and also enabling/disabling, the
paste/undo command depending on whether there was any text on the
clipboard.  It could get more complicated if you wanted to cut/copy out of
something like a datagrid.

Pete
lcSQL Software <http://www.lcsql.com>



On Sat, Jul 14, 2012 at 12:23 PM, J. Landman Gay
<jacque at hyperactivesw.com>wrote:

> There were some changes made in the engine to allow additional menu item
> parameters, but the command keys should still work. If they don't, try
> changing your menu group into a shared card group instead of a background
> group. That way they are more likely to receive keyboard input.
>
> If that still doesn't work, the handler to catch copy/paste is very simple:
>
> on commandkeyDown pKey
>   switch pKey
>     case "x"
>       cut
>       break
>     case "v"
>       paste
>       break
>     case "c"
>       copy
>       break
>     case "z"
>       undo
>       break
>     default
>       pass commandKeyDown
>   end switch
> end commandkeyDown
>



More information about the use-livecode mailing list