Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!ucsd!ucbvax!ucdavis!iris!lim From: lim@iris.ucdavis.edu (Lloyd Lim) Newsgroups: comp.sys.mac.programmer Subject: Re: How does one detect whether a modifier key is being held down? Keywords: Modifier key Message-ID: <7916@ucdavis.ucdavis.edu> Date: 2 Nov 90 20:01:48 GMT References: <5467@quiche.cs.mcgill.ca> Sender: usenet@ucdavis.ucdavis.edu Reply-To: lim@iris.ucdavis.edu (Lloyd Lim) Organization: U.C. Davis - Department of Electrical Engineering and Computer Science Lines: 18 In article <5467@quiche.cs.mcgill.ca> monching@quiche.cs.mcgill.ca (Patrick WONG) writes: >Does anyone know if you can detect whether a modifier key is held down >without having to press a character key or clicking the mouse? > >I know this is possible because MacPaint II will change the arrow to a >hand for option key and magifying glass for a command key. In my main event loop, I just check the modifiers on every event and adjust the cursor if necessary. You may have to restrict yourself to certain events or situations for adjusting the cursor, depending on what you're doing. Note that with MultiFinder, you should also adjust the cursor on mouse-moved events (if it makes sense to do so). It's convenient to to have one adjust cursor routine to use for both cases. +++ Lloyd Lim Internet: lim@iris.ucdavis.edu (128.120.57.20) Compuserve: 72647,660 US Mail: 215 Lysle Leach Hall, U.C. Davis, Davis, CA 95616