Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!blkcat!f421.n109.z1.fidonet.org!Ken.Knight From: Ken.Knight@f421.n109.z1.fidonet.org (Ken Knight) Newsgroups: comp.sys.mac.hypercard Subject: Re: Multi-function Button Message-ID: <3287.27AFE1D6@blkcat.fidonet.org> Date: 5 Feb 91 23:19:53 GMT Sender: ufgate@blkcat.fidonet.org (newsout1.26) Organization: FidoNet node 1:109/421 - The Twilight Clone, Paul Heller Lines: 31 rgoldstone@OAVAX.CSUCHICO.EDU (Robin Goldstone) asks: >I have a button that is used to control a counter. Every time you >click >the button, the value of the counter is incremented by one. I would >also >like to have a way for the same button to decrement the counter. >Either >option-click or command-click or control-click. Can my button script >check to see if one of these keys was held down when the mouse was >clicked? Yes, you can use the various functions such as optionKey, commandKey, and controlKey which all return either "up" or "down" within say an if..then statement and then act accordingly. Thus: on mouseup if the optionKey is down then decrement counter else increment counter end mouseup Internet: ken.knight@f421.n109.z1.fidonet.org America Online: KenKnight "Goodness me; could this be; Industrial Disease?" -- Ken Knight, Ken.Knight@f421.n109.z1.fidonet.org via The Black Cat's Shack's FidoNet<->Usenet Gateway blkcat.fidonet.org and Fidonet 1:109/401