home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!sunic!random.se!ianf
- Date: Sat, 22 Aug 92 00:17:35 +0200
- From: ianf@random.se (Ian Feldman)
- Newsgroups: comp.sys.mac.hypercard
- X-Hear: Sally's (Meg Ryan's) fake diner orgasm now available as plug-in
- X-This: charger sound for the Apple PowerBook; reason enough to buy one
- Apparently-To: rnews@sunet.se
- Message-ID: <a6bb3818@random.se>
- X-Mailer: Fernmail 1.2b2
- Organization: random design -- "Opinions, cheaply"
- Lines: 40
- Subject: trapping arrowkeys INSIDE a mouseWithin handler
-
-
- Is there a more _optimal/_faster_ way to detect possible arrow
- presses WHILE mouse rests above a field with an important
- mouseWithin handler? The latter takes care of all detection
- of (equivalent to) mouseDown, mouseStillDown, mouseUp and
- mouseLeave events faster and with a higher degree of precision
- than separate handlers for each would allow. Now I'd like to
- enhance it still, be adding detection of left and right arrow
- keys, to permit going to prev/ next card even the mouseWithin
- loop is executing.
-
-
- on mouseWithin --example of working code;
- repeat while <condition>
- ----[code]
-
- watch4arrows numtochar(inkey())-27 --returns "1" or "2" if left
- --or right arrow key pressed;
- ----[code] --other values ignored;
- end repeat
- end mouseWithin
-
- on watch4arrows keyValue --if left or right arrow then
- if param(1) is in "12" --go in the indicated direction;
- then do "go" &&item param(1) of "prev cd,next cd" &&"of this bg"
- end watch4arrows
-
-
- Using keyDown message of HyperCard 2.0 is NOT an option since
- it'd require a private handler of its own. That's why I had to
- employ the inkey XFCN by Guy Picciotto [sp?]. Unfortunately it
- doesn't work when the command key is also down, thus preventing
- detection and possible simulation of HC's hardwired cmd-left-
- arrow/ cmd-right-arrow actions (=go to first/ go to last card).
-
- Or am I, perhaps, missing something VERY obvious?
-
-
- ----Please reply SOLELY via email ------> ianf@random.se
-