[comp.sys.mac.hypercard] How to trap keypresses in text fields??

d83_sven_a@tekn01.chalmers.se (Sven (Sciz) Axelsson) (08/24/88)

Why is there not a "on anyKey" message in HyperCard??
What I really want is to trap every character (including BS, RETURN and
arrow keys) that is typed into a certain field and then store this together
with some other information (the TickCount) someplace else. This ought to
be done something like:

	on anyKey theKey
	    put theKey && ticks() & return after "The Field"
	end anyKey

I have written an XFCN that does an EventAvail to check for keyboard
events which returns the ASCII code for the key pressed. The problem
here is to decouple the calling of this XFCN enough to get HyperCard
to perform its normal tasks of tracking menus etc.
Can this be done in any way at all? Will it be done "as it ought to"
in some forthcoming version (APPLE people take note!).

Any info on this will be much appreciated

	//SaX//