Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#5180 ctrl-drag not working on mac

closed-fixed
Client (142)
5
2011-05-11
2011-04-30
sjtsp2008
No

on my mac, ctrl-drag does not work the same as it does on windows - if i hold ctrl down,
the drag does not even start.

holding down command key, or option key, rather than ctrl, results in just a normal drag.

i talked a a little bit about this to kiheru in chat, and will try to identify what is the correct
modifier to use on a mac.

osx 10.6.7, java 1.6.0_24

Discussion

  • sjtsp2008
    sjtsp2008
    2011-05-01

    an important point that i forgot to mention - i'm using a three-button mouse instead of
    of the annoying one-button mouse. so, right-click works like it does on linux/windows.
    i think control-left-button is used to simulate right mouse.
    maybe that's part of the issue ...

     
  • Kimmo Rundelin
    Kimmo Rundelin
    2011-05-01

    Does ctrl-click bring up the item menu then? The client indeed should use the normal mac convention for context menues. If that collides with the ctrl-drag, we'll need to pick another modifier for the quantity selector. You could try if there's difference in behaviour with the one button mouse if you still have that somewhere (in which case it would be an issue with the mouse drivers; luckily something that should not be too hard to work around though)

     
  • sjtsp2008
    sjtsp2008
    2011-05-01

    i have not tested with a one-button mouse yet (have to find it), but i ran some
    simple tests, and ctrl-drag just does not work with my mouse.
    command-drag works, though, and i think the following change to showAmountChooser
    should work. (sorry, i'm still new to eclipse, so i don't know how to build/test yet, nor to
    create a patch):

    private boolean showAmountChooser(MouseEvent event, IEntity entity) {
    if (((event.getModifiersEx() & (MouseEvent.CTRL_DOWN_MASK|MouseEvent.META_DOWN_MASK) != 0)
    && (entity instanceof StackableItem)) {
    return ((StackableItem) entity).getQuantity() > 1;
    }
    return false;
    }

    the change is to add |MouseEvent.META_DOWN_MASK

    i've tried testing some code that looks exactly like that, except with a simple
    swing widget, and it seems to work.

     
  • sjtsp2008
    sjtsp2008
    2011-05-10

    attaching a patch that works on my mac.

    i am unable to find my original one-button mouse.
    i have not been able to test on a windows machine, but the change was trivial.

     
  • sjtsp2008
    sjtsp2008
    2011-05-10

    ok, finally found the original mac mouse. behavior is the same on 0.93.1 - ctrl-click brings up context menu, ctrl-drag does not work, cmd-drag drags but does not bring up the "how much"
    dialog.
    with the patch applied, cmd-drag works for both types of mice - brings up the "how much"
    dialog.

     
  • Kimmo Rundelin
    Kimmo Rundelin
    2011-05-11

    Thank you for the patch and investigating the issue. I have applied the patch to CVS now.

     


Anonymous


Cancel   Add attachments