[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] key event handler in dialogs



At 04.55 1998.05.01, Alan Fry wrote:
>If you look at Dialogs.pm you will find the line;
>
>        defined($handled = $_[0]->callhook("key", @_)) and return $handled;
>
>which leads one to suppose that if you were to return 'undef', (a zero is
>'defined' within the meaning of the act) the key stroke would be regarded
>as 'not' handled' and passed on to the default handling procedure.
>
>However this is defeated by a line in Hooks.pm which reads;
>
>        $hook = "Sort of defined" unless defined ($hook);
>
>which has the effect of always converting an undefined return to the
>very-much-defined string "Sort of defined". I am not sure why this line is
>there, but feel it might perhaps be better if it were not.
>
>This line has the effect that if you intercept _any_ key, you are forced to
>handle _all_ keys. Since all hook calls are similarly drafted, the same
>sine qua non applies to the interception of 'clicks', 'updates', or
>anything else for which one might set a hook.

Ah!  Matthias, we need a word from you on this.  I too (obviously) was
wondering why returning undef/unhandled did not allow the keypresses to go
directly into the text filed in the dialog box.  It seems wrong to me that
they do not.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
MacPerl: Power and Ease (ISBN 1881957322), http://www.ptf.com/macperl/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch