Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsDnD with a modifier key
https://www.eclipse.org/forums/index.php/mv/msg/159457/503708/#msg_503708
is DnD with a modifier key supported? "DropTargetEvent" does not provide
"stateMask" to check modifier keys.
I just want to distinguish between simple "DnD" and "DnD + Ctrl". Is
there any other way (or workaround) to do it.
Thanks,
Karel]]>Karel Brezina2009-12-15T07:38:04-00:00Re: DnD with a modifier key
https://www.eclipse.org/forums/index.php/mv/msg/159457/503750/#msg_503750
Not exactly, but almost. The event's detail field indicates whether the
operation is a move, copy, etc., which is what ultimately matters for DND.
The problem is that the modifiers that distinguish these cases are not
consistent across platforms. For instance, on win32 and gtk: copy ==
DND+ctrl, but on OSX: copy == DND+Alt. This is why the event's stateMask is
abstracted to a DND operation that respects the platform convention. Is
differentiating the type of operation the reason that you want to know the
modifier?
If this is not why you want to know the stateMask, then the only workaround
that comes to mind is to add a DragDetect filter on the Display, as this
event will give you the stateMask at drag time. When you receive the event
you can store its stateMask somewhere until a DropTargetEvent is received
for which you want it. The only case this approach will not catch is
dragging from outside of your app into it.
"Karel Brezina" <karel.brezina@cloudsmith.com> wrote in message
news:hg7uu1$v8r$1@build.eclipse.org...
> Hi,
>
> is DnD with a modifier key supported? "DropTargetEvent" does not provide
> "stateMask" to check modifier keys.
>
> I just want to distinguish between simple "DnD" and "DnD + Ctrl". Is
> there any other way (or workaround) to do it.
>
> Thanks,
> Karel]]>Grant Gayed2009-12-15T15:47:19-00:00Re: DnD with a modifier key
https://www.eclipse.org/forums/index.php/mv/msg/159457/503770/#msg_503770
use the same modifier key on all platforms. I use DND for a mapping and
DND+ctrl will be used for a special kind of mapping. My usage is a bit
different from the standard MOVE and COPY operations.
Regards,
Karel
Grant Gayed napsal(a):
> Hi Karel,
>
> Not exactly, but almost. The event's detail field indicates whether the
> operation is a move, copy, etc., which is what ultimately matters for DND.
> The problem is that the modifiers that distinguish these cases are not
> consistent across platforms. For instance, on win32 and gtk: copy ==
> DND+ctrl, but on OSX: copy == DND+Alt. This is why the event's stateMask is
> abstracted to a DND operation that respects the platform convention. Is
> differentiating the type of operation the reason that you want to know the
> modifier?
>
> If this is not why you want to know the stateMask, then the only workaround
> that comes to mind is to add a DragDetect filter on the Display, as this
> event will give you the stateMask at drag time. When you receive the event
> you can store its stateMask somewhere until a DropTargetEvent is received
> for which you want it. The only case this approach will not catch is
> dragging from outside of your app into it.
>
> You may also wish to CC yourself to
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=71538 , as this could also
> help with what you want.
>
> HTH,
> Grant
>
>
> "Karel Brezina" <karel.brezina@cloudsmith.com> wrote in message
> news:hg7uu1$v8r$1@build.eclipse.org...
>> Hi,
>>
>> is DnD with a modifier key supported? "DropTargetEvent" does not provide
>> "stateMask" to check modifier keys.
>>
>> I just want to distinguish between simple "DnD" and "DnD + Ctrl". Is
>> there any other way (or workaround) to do it.
>>
>> Thanks,
>> Karel
>
>]]>Karel Brezina2009-12-15T16:46:38-00:00