Article View: comp.sys.mac
Article #21308why applications should ask for mouseUp events
From: Cs313s19
Date: Fri, 06 Nov 1987 06:32
Date: Fri, 06 Nov 1987 06:32
28 lines
2057 bytes
2057 bytes
Inside Macintosh's chapter on the Toolbox Event Manager recommends that
you always use "everyEvent" when calling GetNextEvent, so you get all
types of events. I never thought this was important, until I neglected
to ask for "mouseUp" events in an application.
My program ignores certain mouseDown events (such as when you click in
part of a window which has no meaning). When the corresponding mouseUp
event goes into the queue, it stays there. (A mouseDown which is tracked
has its mouseUp consumed by something like MenuSelect or TrackControl.)
The problem: When I click on a menu, MenuSelect calls WaitMouseUp, to
see if there's been a mouseUp. There *is* a mouseUp in the queue, so
MenuSelect stops tracking, and never draws the menu. The mouseUp gets
consumed by this, *but* then I release the mouse when the menu fails to
track, and the number of queued mouseUps stays the same. (Is there a
Law of Conservation of...?)
Similarly, controls always "fire" immediately, without tracking. The feel
of this whole mess is sort of as if your mouse could never drag, only click.
When I changed my GetNextEvent call to ask for mouseUps, the problem
went away, of course. Moral: Read the fine print.
-- Mike Morton // P.O. Box 11378, Honolulu, HI 96878, (808) 456-8455 HST
INTERNET: cs313s19@uhccux.uhcc.hawaii.edu
UUCP: {ihnp4,uunet,dcdwest,ucbvax}!sdcsvax!nosc!uhccux!cs313s19
BITNET: cs313s19%uhccux.uhcc.hawaii.edu@rutgers.edu
Technical Details
Message-ID:
<1068@uhccux.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!rutgers!ukma!gatech!hubcap!ncrcae!ncr-sd!hp-sdd!ucsdhub!sdcsvax!nosc!humu!uhccux!cs313s19Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!rutgers!ukma!gatech!hubcap!ncrcae!ncr-sd!hp-sdd!ucsdhub!sdcsvax!nosc!humu!uhccux!cs313s19 From: cs313s19@uhccux.UUCP (Cs313s19) Newsgroups: comp.sys.mac Subject: why applications should ask for mouseUp events Message-ID: <1068@uhccux.UUCP> Date: Fri, 6-Nov-87 01:32:16 EST Article-I.D.: uhccux.1068 Posted: Fri Nov 6 01:32:16 1987 Date-Received: Sun, 8-Nov-87 14:49:17 EST Organization: U. of Hawaii, Manoa (Honolulu) Lines: 27 Keywords: events mouseUp annoying