mouseclick count
in
Contributed Library Questions
•
2 years ago
Hello,
it seems I've made something wrong with the mousclick count. I want to track double clicks on the left mouse button:
regards,
johannes
it seems I've made something wrong with the mousclick count. I want to track double clicks on the left mouse button:
- /**
* Implements processing mousePressed.
*
* @param paramEvent
* The {@link MouseEvent}.
*
* @see processing.core.PApplet#mousePressed
*/
void mousePressed(final MouseEvent paramEvent) {
mControlP5.controlWindow.mouseEvent(paramEvent);
// Mouse rollover.
final int hitTestIndex = rollover(State.CLICK);
if (!mShowGUI && hitTestIndex != -1) {
switch (paramEvent.getClickCount()) {
case 1:
System.out.println("SINGLE CLICK");
break;
case 2:
switch (mParent.mouseButton) {
case PConstants.LEFT:
mLastItems.add(new ArrayList<SunburstItem>(mItems));
final long nodeKey = mItems.get(hitTestIndex).mNode.getNodeKey();
mModel.traverseTree(nodeKey, mTextWeight);
break;
case PConstants.RIGHT:
break;
default:
// Take no action.
}
break;
default:
// Take no action.
}
}
}
regards,
johannes
3