Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MrFusion

macrumors 6502a
Original poster
Jun 8, 2005
613
0
West-Europe
Hi,

I have an NSOutlineView with drag and drop. I want to add NSFilesPromisePboardType as a dragtype. However, based on which modifer key is pressed at the time of drop (e.g. in the finder), I want to create different files and different filecontent. This should be possible, since I keep a pointer to the dragged data around (i.e. the data is not written to the pasteboard directly).

According to the docs, I should implement this function.
Code:
-(NSArray *) outlineView:(NSOutlineView *)outlineView namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination forDraggedItems:(NSArray *)items

But it's not telling what kind of NSDragoperation (generic/move/copy/... as determined by the modifer keys such as command and option) was performed.

If I drag, I want to create a file with the original, imported content.
If I command-drag, or option-drag, I want to create a file which has new, derived content.

Is there a way around this?

Thanks
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
For a command-drag, you could try checking for ([[NSApplication currentEvent] modifierFlags] & NSCommandKeyMask)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.