[comp.sys.mac.programmer] event filtering

benkei@cs.utexas.edu (William Kent Richards) (10/07/90)

Anyone know how to get a program or DA sit on top of other
applications and filter events, then pass the filtered events
to the application?  I want a small program that can intercept
events and pass some, react to some, and change some (ex:
remap keys).

Also, how can I get this program to effectively put it's own menu
in the app's menu bar?

--------
Kent Richards
benkei@cs.utexas.edu

francis@arthur.uchicago.edu (Francis Stracke) (10/07/90)

In article <39@neches.cs.utexas.edu> benkei@cs.utexas.edu (William Kent Richards) writes:
>
>Anyone know how to get a program or DA sit on top of other
>applications and filter events, then pass the filtered events
>to the application?  I want a small program that can intercept
>events and pass some, react to some, and change some (ex:
>remap keys).

 Remapping events can be done with a journaling device driver, I think.
 Most (in)famous example probably MacroMaker.  See IM I-261.

>Also, how can I get this program to effectively put it's own menu
>in the app's menu bar?

Any DA can get a menu.  Of course, under MF it'll show up in the DA
 Handler Layer (unless you force the DA to load into the current app).
 Depending on what you're doing, it may be more appropriate to have
 a cdev (if you're just configuring the driver--if that's what you
 use--that logically belongs in a cdev).


| Francis Stracke		| My opinions are my own.  I don't steal them.|
| Department of Mathematics	|=============================================|
| University of Chicago		| A mathematician is a professional	      |
| francis@zaphod.uchicago.edu	|   schizophrenic.--Me.		       	      |

zellers@prisoner.Eng.Sun.COM (Steve Zellers) (10/08/90)

In article <39@neches.cs.utexas.edu> benkei@cs.utexas.edu (William Kent Richards) writes:
>Also, how can I get this program to effectively put it's own menu
>in the app's menu bar?

This is usually done by patching several traps...  The method is generally to
patch _DrawMenuBar to draw your menu after the last menu's right edge (there 
are low memory globals you get this from), then you insert your menus in
response to menubar clicks, and delete the menu on a mouse up.  (I could
post code to do this, if you like...)

--
------------------------------------------------------------------------
Steve Zellers 					zellers@prisoner.sun.com
"All you slimy  fruitcakes in San Fransisco are going to find out how to 
get to 180 and the letter 'G'. I repeat, there is No Other Possibility."