﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
112	"Near-click plugin for ""selecting things with tablet pen"""	josm@…	imi	"
For some highly irritating reason when using a tablet pc pen input, java doesn't register about three quarters of all screen taps as mouseClick events. This is actually because when using a waacom tablet the mouse press and mouse release are very rarely on the same pixel -- for Java this then doesn't constitute a click.

This makes basic editing a pain in the behind.

One solution (well, workaround really) is to process the mouse press and release events to check for ""almost clicks"".

In the JOSM code this can be done in the MapMode.java class:

{{{
	private int mouseDownX = -1;
        private int mouseDownY = -1;
        private long mouseDownTime = -1;

	public void mouseReleased(MouseEvent e) {
		if ( e.getButton() != MouseEvent.BUTTON1 )
			return;

		if ( e.getWhen() - mouseDownTime < 250 &&
			e.getPoint().x - mouseDownX < 7 &&
			e.getPoint().y - mouseDownY < 7 &&
			e.getPOint().x != mouseDownX &&
			e.getPoint().y != mouseDownY ) {
			mouseClicked(e);
		}
	}

	public void mousePressed(MouseEvent e) {
		if ( e.getButton() != MouseEvent.BUTTON1 )
			return;

		mouseDownX = e.getPoint().x;
		mouseDownY = e.getPoint().y;
                mouseDownTime = e.getWhen();
	}
}}}

This solution has been tested and works pretty well.
"	enhancement	closed	major		Core	latest	fixed		
