Hi Alan, On Sun, 25 Mar 2018 at 12:57:32 +0100, Alan Third wrote: > Looks like this is how the modifiers are set in performDragOperation > > if (! (op & (NSDragOperationMove|NSDragOperationDelete)) && > // URL drags contain all operations (0xf), don't allow all to be set. > (op & 0xf) != 0xf) > { > if (op & NSDragOperationLink) > modifiers |= NSEventModifierFlagControl; > if (op & NSDragOperationCopy) > modifiers |= NSEventModifierFlagOption; > if (op & NSDragOperationGeneric) > modifiers |= NSEventModifierFlagCommand; > } > > modifiers = EV_MODIFIERS2 (modifiers); > > It’s setting the actual modifier keys, so when a user changes those > keys’ settings this breaks. > > You can also set these flags by using the actual modifier keys. > > This looks like it matches up with what Apple expect you to do, but it > doesn’t seem to match up with Emacs’s event handling very well. That looks about right to me too, it least it matches the general approach in the docs. I had a go at mapping the hardware modifiers to Emacs events (and existing bindings) for each drag type and DragOperation mask. Patch attached. This doesn't support the ns-right-*-modifiers yet, but they should be pretty easy to add if you want to go this way.