[comp.sys.mac.hypercard] Trapping Keypresses

90_GRAZA%UNION.BITNET@CUNYVM.CUNY.EDU (05/28/89)

Greetings,
        Can anyone help me figure the best way to be able to use the numberic
keypad as input for a small calculator stack I have written that was originally
designed for all mouse input?  I figure if there is no way to trap keypresses,
I could put true into BlindTyping (English immitates HyperTalk) and get the
messagebox from within an idle script.  This may work, but it sounds very
interfering.  I was only using HC 1.0 until a few days ago so the answer might
be obvious but help would be appreciated.

Thanks,

Jason

RatRunner@cup.portal.com (Geoff RatRunner Crooks) (05/30/89)

In response to the following :
Greetings,
        Can anyone help me figure the best way to be able to use the numberic
keypad as input for a small calculator stack I have written that was originall
designed for all mouse input?  I figure if there is no way to trap keypresses,
I could put true into BlindTyping (English immitates HyperTalk) and
 get the
messagebox from within an idle script.  This may work, but it sounds very
interfering.  I was only using HC 1.0 until a few days ago so the answer might
be obvious but help would be appreciated.

Thanks,

Jason
-----

There is an XCMD around that does just this.  I believe I have a copy.
If there is interest, I will post it, or E-mail it (if I can find it).
Geoff.
RatRunner@cup.portal.com

rieman@boulder.Colorado.EDU (John Rieman) (05/30/89)

I could also use a copy of the XCMD that traps keypresses.

-john

taylorj@yvax.byu.edu (06/03/89)

I know of two ways to trap keypresses.  Both require XCMDs.  The first is an
XFCN called InKey that will return any pending keypressed when called.  You put
it in an idle loop.  It works ok if the user doesn't type too fast.

The other is an XCMD called ControlLock that makes the Mac think the Control
key is locked (even on keyboards with no Control key), thus generating a
controlKey message on every keypress.  (I prefer this one, as you get a message
generated for every keypress and never lose any.)

These are both short, and have both been posted to this newsgroup.  If enough
people clamor, I can repost them.

Jim Taylor
Microcomputer Support for Curriculum
Brigham Young University
taylorj@byuvax.bitnet

Aunt.Billy@f54.n382.z1.FIDONET.ORG (Aunt Billy) (06/04/89)

   I've run across the same problem, and as far as I know, the blind
typing route is the only one available.  But it is SLOW going.  I've been
toying with the idea of an external function to trap key presses...


--  
Aunt Billy  via cmhGate - Net 226 fido<=>uucp gateway Col, OH
UUCP:  ...!osu-cis!n8emr!cmhgate!382!54!Aunt.Billy

ollef@osiris.sics.se (Olle Furberg) (06/04/89)

In article <621taylorj@yvax.byu.edu> taylorj@yvax.byu.edu writes:
>The other is an XCMD called ControlLock that makes the Mac think the Control
>key is locked (even on keyboards with no Control key), thus generating a
>
>These are both short, and have both been posted to this newsgroup.  If enough
>people clamor, I can repost them.

Yes, plzz!