copy from a locked, focusable fld under Windows (results & one question)

André.Bisseret Andre.Bisseret at
Sun Mar 26 14:10:51 EST 2006

Hi !
I tested on Windows. So, I report my results as Jim Ault wanted me to 

1 - Intercepting "command 'c' and/or 'C'" :
The handler suggested by Jonathan (below) works  on Windows as well as 
on Mac.

Also, this simpler handler works on Windows as well as on Mac. :

on copySelection
copy the selectedText -- the html form is kept :-)
end copySelection

2 - BUT, if these handlers are triggered from a button :
on Mac, it is OK
on Windows, that does not work with the mouse "left button", but does 
work with the "right button"  (discovered by chance by one testor) !
It seems as if the click on the button using the left mouse button on 
Windows deselects the text that was selected in the field.

Now, Windows users told me that this should be done using the left 
button :-((

I tried, in the script of the button:
set the menuMouseButton of me to 1
No success ! it keeps working only with the right button.

Thanks in advance for any suggestion,

Best regards from Grenoble

> De: André.Bisseret <Andre.Bisseret at>
> Date: Mon 13 Mar 2006  11:53:10 Europe/Paris
> À: How to use Revolution <use-revolution at>
> Objet: Rép : copy from a locked, focusable fld under Windows
> Thanks a lot to Jonathan, Wilhelm, Jim and Chipp for their very useful 
> ideas and solutions.
> I confirm that here (G4, OSX, 10.2.8 -RR 2.6.1) neither "command c" 
> nor "command C" is working (; but as Wilhelm said "Copy text" from 
> Edit menu works.
> Meanwhile, "command v" as well as "command V" works.
> The following handler works on Mac, keeping the html form :
> on copySelection
>   if the selection is empty then   -- there is no selection then
>    answer "No selected text"
>    exit copySelection
>  else
>    copy the selectedText
>    answer "The selected text is in the clipboard"
>    end if
> end copier
> In order to try on Windows, I made another button, and I intercepted 
> "command c"  using the handler of Jonathan (below).
> Nevertheless, I needed to replace  the line "if the selectedfield <> 
> empty then" by "if the selection is empty then" (or "if the 
> selectedText is empty" as well).
> The reason is that a single click in the field (without any text 
> selected) is setting "the selectedfield <> empty" to true (so that it 
> is reporting "The selected text is in the clipboard" and then copying 
> nothing).
> I have not had the opportunity to test that on Windows yet.
> I will inform you about the results as soon as I would have done it :-)
> Best regards from Grenoble
> André
> Le Saturday, 11 Mar 2006, à 00:16 Europe/Paris, Jonathan Lynch a écrit 
> :
>> This is how I would up doing it:
>> on RawKeyDown pKey
>>   if (pKey = 99 or pKey = 67) and the commandkey is down then
>>     if the selectedfield <> empty then
---prefer "if the selection (or the selectedText) is empty (see above)
>>       put the selection into tSel
>>       put the htmltext of the selection into tSelHtml
>>       set the clipboarddata["text"] to tSel
>>       set the clipboarddata["html"] to tSelHtml
>>       select the selectedchunk
>>       exit rawkeydown
>>     end if
>>   end if
>>   pass rawkeydown
>> end rawkeydown
>> This is adapted from a the rawkeydown handler in taskmage, which does 
>> a
>> bunch of other stuff that does not need to be included here.
>> I find this script works well, and allows you to copy both formatted 
>> and
>> unformatted text so that it can be copied from a rev application and 
>> pasted
>> into any other application.

More information about the Use-livecode mailing list