Re: Detect ALT key pressed during dragging
Re: Detect ALT key pressed during dragging
- Subject: Re: Detect ALT key pressed during dragging
- From: Lorenzo <email@hidden>
- Date: Mon, 17 May 2004 17:55:18 +0200
Hi Joar,
you are right, the draggingSourceOperationMaskForLocal method in my
NSTableView subclass of my application "ListFilesApp" returns
NSDragOperationCopy always.
The problem is that when I drag a table-row (it contains a file path) to the
Finder I want to "copy" that file to the Finder. So I have to return
NSDragOperationCopy otherwise the Finder "moves" the file and I make a
disaster.
Instead if I drag a row to another application I don't want to get
NSDragOperationCopy automatically. The destination application should detect
the current and real modifier key.
I think that the problem is that Cocoa joins the modifier key to an
operation automatically. Instead I would like to treat them as two different
things. Anyway, if this is so hard, I will find a different way to set the
source file to the destination application avoiding the use of the modifier
key. Thanks for your support.
Best Regards
--
Lorenzo
email: email@hidden
>
From: j o a r <email@hidden>
>
Date: Sun, 16 May 2004 15:52:16 +0200
>
To: Lorenzo <email@hidden>
>
Cc: Cocoa Dev Dev <email@hidden>
>
Subject: Re: Detect ALT key pressed during dragging
>
>
What kind of drag operations does the source provide (as specified by
>
draggingSourceOperationMaskForLocal:)?
>
>
j o a r
>
>
On 2004-05-16, at 12.17, Lorenzo wrote:
>
>
> thank you. I tried that and if I drag a file from the Finder, it works
>
> properly. But if I drag a NSFilenamesPboardType from my other
>
> application
>
> "ListFilesApp", the draggingSourceOperationMask method always returns
>
> NSDragOperationCopy, even if the ALT is not pressed.
>
>
>
>
>
> In "ListFilesApp" I defined the drag like this:
>
>
>
> - (BOOL)tableView:(NSTableView *)tv writeRows:(NSArray*)rows
>
> toPasteboard:(NSPasteboard*)pboard
>
> {
>
> // ...get the list of the file paths.
>
>
>
> NSArray *types = [NSArray arrayWithObjects:NSFilenamesPboardType,
>
> nil];
>
> [pboard declareTypes:types owner:self];
>
> [pboard setPropertyList:filePathList
>
> forType:NSFilenamesPboardType];
>
> }
>
>
>
> So, now I suppose that I missed something in my "ListFilesApp"
>
> application.
>
> What?
_______________________________________________
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.