Revision: 20756 http://sourceforge.net/p/jmol/code/20756 Author: hansonr Date: 2015-09-05 04:19:46 +0000 (Sat, 05 Sep 2015) Log Message: ----------- more mouse
Modified Paths: -------------- trunk/Jmol/src/org/jmol/awt/Mouse.java trunk/Jmol/src/org/jmol/awtjs2d/Mouse.java Modified: trunk/Jmol/src/org/jmol/awt/Mouse.java =================================================================== --- trunk/Jmol/src/org/jmol/awt/Mouse.java 2015-09-05 04:00:28 UTC (rev 20755) +++ trunk/Jmol/src/org/jmol/awt/Mouse.java 2015-09-05 04:19:46 UTC (rev 20756) @@ -309,12 +309,14 @@ private void mouseEntered(long time, int x, int y) { wheeling = false; isMouseDown = false; + modifiersDown = 0; manager.mouseEnterExit(time, x, y, false); } private void mouseExited(long time, int x, int y) { wheeling = false; isMouseDown = false; + modifiersDown = 0; manager.mouseEnterExit(time, x, y, true); } @@ -381,7 +383,6 @@ return; if ((modifiersDown & Event.MAC_COMMAND) == Event.MAC_COMMAND) modifiersDown = modifiersDown & ~Event.MOUSE_RIGHT | Event.CTRL_MASK; - System.out.println(modifiers + " " + modifiersDown); manager.mouseAction(Event.DRAGGED, time, x, y, 0, modifiersDown); } Modified: trunk/Jmol/src/org/jmol/awtjs2d/Mouse.java =================================================================== --- trunk/Jmol/src/org/jmol/awtjs2d/Mouse.java 2015-09-05 04:00:28 UTC (rev 20755) +++ trunk/Jmol/src/org/jmol/awtjs2d/Mouse.java 2015-09-05 04:19:46 UTC (rev 20756) @@ -330,6 +330,8 @@ private void entry(long time, int x, int y, boolean isExit) { wheeling = false; + isMouseDown = false; + modifiersDown = 0; manager.mouseEnterExit(time, x, y, isExit); } @@ -350,11 +352,12 @@ private boolean isMouseDown; // Macintosh may not recognize CTRL-SHIFT-LEFT as drag, only move private boolean wheeling; + private int modifiersDown; private void moved(long time, int x, int y, int modifiers) { clearKeyBuffer(); if (isMouseDown) - manager.mouseAction(Event.DRAGGED, time, x, y, 0, applyLeftMouse(modifiers)); + manager.mouseAction(Event.DRAGGED, time, x, y, 0, modifiersDown); else manager.mouseAction(Event.MOVED, time, x, y, 0, modifiers); } @@ -378,12 +381,14 @@ boolean isPopupTrigger) { clearKeyBuffer(); isMouseDown = true; + modifiersDown = modifiers; wheeling = false; manager.mouseAction(Event.PRESSED, time, x, y, 0, modifiers); } private void released(long time, int x, int y, int modifiers) { isMouseDown = false; + modifiersDown = 0; wheeling = false; manager.mouseAction(Event.RELEASED, time, x, y, 0, modifiers); } @@ -391,9 +396,9 @@ private void dragged(long time, int x, int y, int modifiers) { if (wheeling) return; - if ((modifiers & Event.MAC_COMMAND) == Event.MAC_COMMAND) - modifiers = modifiers & ~Event.MOUSE_RIGHT | Event.CTRL_MASK; - manager.mouseAction(Event.DRAGGED, time, x, y, 0, modifiers); + if ((modifiersDown & Event.MAC_COMMAND) == Event.MAC_COMMAND) + modifiersDown = modifiersDown & ~Event.MOUSE_RIGHT | Event.CTRL_MASK; + manager.mouseAction(Event.DRAGGED, time, x, y, 0, modifiersDown); } private static int applyLeftMouse(int modifiers) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ _______________________________________________ Jmol-commits mailing list Jmol-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-commits