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

Re: [MacPerl] keyUp detection



>David Seay writes Tue, 15 Dec 1998 22:36:49 -0600:
>
>>In the following code I can detect 'keyDown', 'mouseDown', and 'mouseUp'
>>but not 'keyUp'.
>>What's up with that?
>
>I can't see anything wrong with the code, and I agree with you, after much
>tinkering, that it just doesn't work.
>
>Timothy Knox <tdk@pitnet.net> adds:
>
>>The MacOS global event filter strips out keyUp events. May I ask, what do
>>you need them for? Or are you just curious as to why you are not getting
>>them?
>>
>>There is a way to change the global event filter, to tell it to pass you
>>all events, including keyUp events, but I don't have that reference
>>handy. If you need it, I can look it up for you.
>
>On the assumption something like this might be happening I tried the
>'everyEvent' mask but still failed to get a 'keyUp' event through. IM says
>you write "WaitnextEvent( --mask-- )" but is that how you do it in MacPerl
>I wonder?
>

[stuff deleted]

The event mask that you pass to WaitNextEvent() is and'ed with the
System event mask.  You need to add keyUp events to the system mask.

#include <Events.h>	
pascal void SetEventMask(short theMask);

is what you would use to set this in C/C++... I don't know if it
is implemented in Perl.  There are lowmem accessors as well. There's
not a highlevel accessor for getting the event mask, though there is
a lowlevel one:

EXTERN_API( SInt16 ) LMGetSysEvtMask(void)	 TWOWORDINLINE(0x3EB8, 0x0144);

EXTERN_API( void ) LMSetSysEvtMask(SInt16 value)	 TWOWORDINLINE(0x31DF, 0x0144);


Tom.
Mrs. Bun: Have you got anything without spam?
Waitress: Well, there's spam egg sausage and spam, that's not got
much spam in it.
Mrs. Bun: I don't want any spam!

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