在ListCell / ListView中,当按下moused时,我需要监听setOnMouseMoved事件。使用下面的代码我可以听moused按下/移动和释放,但是只要我按下moused(并继续按下)我就不能再听移动事件了。当鼠标按下时,我该怎么做才能听到移动事件?
setOnMousePressed(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
Log.d("ListCell - onMousePressed");
}
});
setOnMouseMoved(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
Log.d("ListCell - onMouseMoved");
}
});
setOnTouchPressed(new EventHandler<TouchEvent>() {
@Override
public void handle(TouchEvent event) {
Log.d("ListCell - onTouchPressed");
}
});