Opened 18 years ago
Closed 18 years ago
#112 closed enhancement (fixed)
Near-click plugin for "selecting things with tablet pen"
Reported by: | Owned by: | imi | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Core | Version: | latest |
Keywords: | Cc: |
Description
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.
Attachments (0)
Change History (2)
comment:1 by , 18 years ago
Summary: | Selecting things difficult with tablet pen → Near-click plugin for "selecting things with tablet pen" |
---|---|
Type: | defect → enhancement |
comment:2 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
get the plugin at http://josm.eigenheimstrasse.de/download/plugins/nearclick.jar
This looks like a general problem with table pens and Java rather than a JOSM-specific.
So I'd rather see this as a plugin instead, as example by registering an global AWT-listener and firing an click-event when you "near-click" something.
Anyone up for such a plugin?