• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Detecting option key down/up during drag
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting option key down/up during drag


  • Subject: Re: Detecting option key down/up during drag
  • From: Dan Waylonis <email@hidden>
  • Date: Mon, 17 Nov 2003 10:37:46 -0800

On Nov 16, 2003, at 10:41 PM, Keith Renz wrote:

> I've searched the mamasam archives and haven't found a definitive
> answer. How can I detect the option key down/up during a drag like the
> Finder? I've implemented dragging in a table view, but I want to be
> able to option-drag to make a copy (vs. move) and be able to change my
> mind in the middle of a drag. I can detect the option key immediately
> before the drag starts, but that doesn't help during the drag.

Hi Keith,

There are two ways (off the top of my head):

In Cocoa, if your "dragging" is implemented using mouseDragged: (rather
than an event loop within your own mouseDown:), then you should be able
to implement flagsChanged:(NSEvent *) method to keep track of the
current modifier state.

In Carbon, you can use GetKeys() and interpret the resulting map. Left
as an exercise to the reader... :-)

Dan
_________________________________________________
Dan Waylonis email@hidden
Software Engineer http://www.nekotech.com
nekotech SOFTWARE 650.964.2490 (O)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Detecting option key down/up during drag
      • From: Keith Renz <email@hidden>
References: 
 >Detecting option key down/up during drag (From: Keith Renz <email@hidden>)

  • Prev by Date: Re: Detecting option key down/up during drag
  • Next by Date: Re: setDoubleAction in tableView
  • Previous by thread: Detecting option key down/up during drag
  • Next by thread: Re: Detecting option key down/up during drag
  • Index(es):
    • Date
    • Thread