[comp.sys.mac.programmer] Fake a KeyDown as MouseDown in Moda

leonardr@uxe.cso.uiuc.edu (04/25/88)

soe@ames.arpa(Brad Soe) writes in comp.sys.mac.programmer

>I want to know if it is possible to use the filter function 
>passed to ModalDialog to take a keydown event, change it to 
>a mousedown event, and have ModalDialog process this. I have
>a problem where I have two textedit boxes in a dialog. 
>I want the dialog to behave in such a way that if the user
>hits the return key in one textedit box, the cursor  
>automatically goes to the next text box and activates it.  
>I have tried to modify: event.where to a point in the
>rectangle, set event.what = mouseDown, and 
>OrBit(Event.modifiers, 128) (sets the mouse down bit), but
>it does'nt seem to work.  Is there a way to do this?
>
	Although I have not actually tried this, I see no reason why you could not
just change the keydown from a return to a tab and then pass it back to the
the standard filter which would then process it the way you want.  


+---------------------------------+-----------------------------------+
+                                 +  Any thing I say may be taken as  +
+   Leonard Rosenthol             +  fact, then again you might decide+
+   President, LazerWare, inc.    +  that it really isn't, so you     +
+                                 +  never know, do you??             +
+   leonardr@uxe.cso.uiuc.edu     +                                   +
+   GEnie:  MACgician             +                                   +
+   Delphi: MACgician             +                                   +
+                                 +                                   +
+---------------------------------+-----------------------------------+

tim@ism780c.UUCP (T.W."Tim" Smith, Knowledgian) (04/26/88)

In article <226000008@uxe.cso.uiuc.edu> leonardr@uxe.cso.uiuc.edu writes:
< soe@ames.arpa(Brad Soe) writes in comp.sys.mac.programmer
< >I want the dialog to behave in such a way that if the user
< >hits the return key in one textedit box, the cursor  
< >automatically goes to the next text box and activates it.  
<   Although I have not actually tried this, I see no reason why you could not
< just change the keydown from a return to a tab and then pass it back to the
< the standard filter which would then process it the way you want.  

Why use RETURN in the first place?  Use TAB to mean "go to the next
text box".  This will a) be easier to implement, since it already
works that way, and b) be consistant with the way everyone else
does it.
-- 
Tim Smith				tim@ism780c.isc.com
"I don't practice what I preach because I'm not the
                       kind of person I'm preaching to" -- J.R. "Bob" Dobbs