【发布时间】:2018-09-10 14:07:46
【问题描述】:
我使用 LEFT 和 RIGHT 键来移动视图的位置。当我按住键时,视图会移到一边,暂停片刻,然后继续移动,直到我松开键。是否可以跳过第一个动作和之后的动作之间的暂停?
gridPane.setOnKeyPressed(
e -> {
e.consume();
if (e.getCode() == KeyCode.RIGHT)
{
moveMarkerNextPositionWithKeys(e.isAltDown());
}
else if (e.getCode() == KeyCode.LEFT)
{
moveMarkerPreviousPositionWithKeys(e.isAltDown());
}
}
);
【问题讨论】: