Index: /utils/josm/plugins/nearclick/.classpath
===================================================================
--- /utils/josm/plugins/nearclick/.classpath	(revision 2397)
+++ /utils/josm/plugins/nearclick/.classpath	(revision 2397)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/josm"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
Index: /utils/josm/plugins/nearclick/.project
===================================================================
--- /utils/josm/plugins/nearclick/.project	(revision 2397)
+++ /utils/josm/plugins/nearclick/.project	(revision 2397)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>nearclick</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: /utils/josm/plugins/nearclick/src/nearclick/NearClickPlugin.java
===================================================================
--- /utils/josm/plugins/nearclick/src/nearclick/NearClickPlugin.java	(revision 2397)
+++ /utils/josm/plugins/nearclick/src/nearclick/NearClickPlugin.java	(revision 2397)
@@ -0,0 +1,47 @@
+package nearclick;
+
+import java.awt.AWTEvent;
+import java.awt.AWTException;
+import java.awt.GraphicsEnvironment;
+import java.awt.Robot;
+import java.awt.Toolkit;
+import java.awt.event.AWTEventListener;
+import java.awt.event.MouseEvent;
+
+public class NearClickPlugin implements AWTEventListener {
+
+    private int mouseDownX = -1;
+    private int mouseDownY = -1;
+    private long mouseDownTime = -1;
+
+    public NearClickPlugin() {
+        Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);
+    }
+
+    public void eventDispatched(AWTEvent event) {
+        if (event instanceof MouseEvent) {
+            MouseEvent e = (MouseEvent)event;
+            if ( e.getButton() != MouseEvent.BUTTON1 )
+                return;
+            if (e.getID() == MouseEvent.MOUSE_RELEASED) {
+                if ( e.getWhen() - mouseDownTime < 250 &&
+                        e.getPoint().x - mouseDownX < 7 &&
+                        e.getPoint().y - mouseDownY < 7 &&
+                        e.getPoint().x != mouseDownX &&
+                        e.getPoint().y != mouseDownY ) {
+                    try {
+                        Robot r = new Robot(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice());
+                        r.mousePress(MouseEvent.BUTTON1_MASK);
+                        r.mouseRelease(MouseEvent.BUTTON1_MASK);
+                    } catch (AWTException e1) {
+                    }
+                }                
+            }
+            if (e.getID() == MouseEvent.MOUSE_PRESSED) {
+                mouseDownX = e.getPoint().x;
+                mouseDownY = e.getPoint().y;
+                mouseDownTime = e.getWhen();            
+            }
+        }
+    }
+}
