paste into field does not trigger closefield

Ben Rubinstein benr_mc at cogapp.com
Wed Jun 28 04:24:13 EDT 2006


On 27/6/06 23:37, kee nethery wrote:
> 
> On Jun 27, 2006, at 12:27 PM, Ben Rubinstein wrote:
>> You may well be on top of this, but just in case: note that 'pasteKey' 
>> literally only catches using the keyboard shortcut to paste; if the 
>> user uses "paste" from the standard edit menu, the pasteKey message 
>> isn't sent.
> 
> arrrrg, thanks. That was not obvious to me, thanks, Kee

And I've just noticed that a more useful version of that message, for anyone 
chasing it in the archives later, would have mentioned how to catch these 
cases of the user using the menu directly, rather than using the keyboard: 
that is, pasteKey catches the keyboard shortcut (and ditto "cutKey"); to catch 
someone cutting or pasting from the menu, trap menuPick.  Eg something like this:

	on menuPick w
	   if (w contains "paste") or (w contains "cut") then
		setCompDirty true
	   end if
	   pass menuPick
	end menuPick

   Ben Rubinstein               |  Email: benr_mc at cogapp.com
   Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
   http://www.cogapp.com        |  Fax  : +44 (0)1273-728866




More information about the use-livecode mailing list