Skip to content

Commit

Permalink
longtouch + doubletap
Browse files Browse the repository at this point in the history
  • Loading branch information
thelsing committed Mar 24, 2022
1 parent f3fe467 commit 9b721af
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/main/java/net/rptools/maptool/client/tool/PointerTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -328,27 +328,27 @@ public boolean tap(float x, float y, int count, int button) {
tapPoint.x = (int) x;
tapPoint.y = (int) y;

handleSingleSelectAt(tapPoint, true);
handleSingleSelectAt(tapPoint, count >= 2);
repaintZone();
return false;
}

@Override
public boolean longPress(float x, float y) {
log.info("longPress");
return false;
/*
// return false;

var tapPoint = new Point();
tapPoint.x = (int) x;
tapPoint.y = (int) y;

handleSingleSelectAt(tapPoint, false);
// if we open popup stop handling this touch
if(showTokenPopupAt(tapPoint)) {
if (showTokenPopupAt(tapPoint)) {
return true;
}
startSelectionBox(tapPoint);
return false;*/
return false;
}

@Override
Expand Down Expand Up @@ -771,6 +771,8 @@ private void hideMarkerPopup() {
// Mouse
@Override
public void mousePressed(MouseEvent e) {
log.info("mousePressed " + e.toString());

super.mousePressed(e);

if (handledByHover(e.getPoint())) return;
Expand Down Expand Up @@ -859,6 +861,7 @@ public void mousePressed(MouseEvent e) {

// @Override
public void mouseReleased(MouseEvent e) {
log.info("mouseReleased " + e.toString());
mouseButtonDown = false;
// System.out.println("mouseReleased " + e.toString());

Expand Down Expand Up @@ -990,6 +993,7 @@ public void popupMenuCanceled(PopupMenuEvent popupMenuEvent) {}
// MouseMotion
@Override
public void mouseMoved(MouseEvent e) {
log.info("mouseMoved " + e.toString());
if (renderer == null) {
return;
}
Expand Down Expand Up @@ -1061,6 +1065,7 @@ public void mouseMoved(MouseEvent e) {

// @Override
public void mouseDragged(MouseEvent e) {
log.info("mouseDragged " + e.toString());
mouseX = e.getX();
mouseY = e.getY();

Expand Down

0 comments on commit 9b721af

Please sign in to comment.