Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!gatech!hubcap!jcocon From: jcocon@hubcap.clemson.edu (james c oconnor) Newsgroups: comp.sys.mac.programmer Subject: Dialog Filter - blocking returns Message-ID: <1991Jun19.203617.553@hubcap.clemson.edu> Date: 19 Jun 91 20:36:17 GMT Organization: Clemson University Lines: 35 I am writing a dialog filter routine which checks the condition of the default button. If the button is hilited 255 then the return is converted to a tab. One problem, it doesn't work. Here is the code: pascal Boolean ReturnFilter(DialogPtr dlog,EventRecord *event,int *hit) { char c; ControlHandle Hndl; int type; Rect r; if (event->what == keyDown || event->what == autoKey){ if ((c=event->message & charCodeMask)==CR || c==ENTER){ GetDItem(dlog,1,&type,&Hndl,&r); if (!(*Hndl)->contrlHilite){ event->message &= ~0xFF; event->message |= TAB; c = TAB; } } if (c == CR || c == ENTER){ *hit = 1; return TRUE; } } return FALSE; } TAB, ENTER, and CR are all #defined to be 0x??, and should work since they do in a much more elaborate filter I wrote which does this very thing, plus a whole bunch. Thanks Jim