"Type" issue?

J. Landman Gay jacque at hyperactivesw.com
Mon May 9 14:33:56 EDT 2005


On 5/9/05 6:05 AM, John Ridge wrote:

> Thanks, Alex - now I see what the Message Watcher is for!
> 
> It looks as if the command "type" is behaving improperly. It shouldn't send
> a keyDown message as well as the rawkeyDown message. I infer that I must be
> the first person to issue the command inside a keyDown handler. Well, I said
> it was a silly script.
> 
> To get the infinite loop, try the following very simple script:-
> 
> on keyDown
> type "Hello World"
> end keyDown
> 
> But make sure you have saved all open documents first!
> 
> 

I'm not convinced this is really a bug. The "type" command is meant to 
simulate actual keyboard events, and if a script issues a "type" 
command, it needs to behave exactly as though the user were typing. So, 
I'd expect it to send all related messages.

It is very unusual to send a "type" command within a keydown handler; 
the usual approach would be to "put" the text into/after the field. 
Simulating a typing event inside a keydown seems to me to be a developer 
issue, just as a repeat loop with no exit command would be.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com


More information about the use-livecode mailing list