//Do the jogging.
_axis = " "; // Initialize to no valid axis set
if (!isKeyPressed) { //If this event has already sent a jog in need to pass this over.
KeyCode _kc = keyEvent.getCode();
if (_kc.equals(KeyCode.SHIFT)) {
return; //This is going to toss out our initial SHIFT press for the z axis key combination.
}
if (keyEvent.isShiftDown()) {
//Alt is down so we make this into a Z movement
FEED_RATE_PERCENTAGE = TRAVERSE_FEED_RATE;
} else {
FEED_RATE_PERCENTAGE = NUDGE_FEED_RATE;
}
//Y Axis Jogging Movement
if (_kc.equals(KeyCode.UP) || _kc.equals(KeyCode.DOWN)) {
//This is and Y Axis Jog action
_axis = "Y"; //Set the axis for this jog movment
if (keyEvent.getCode().equals(KeyCode.UP)) {
jogDial = TinygDriver.getInstance().machine.getJoggingIncrementByAxis(_axis);
} else if (keyEvent.getCode().equals(KeyCode.DOWN)) {
jogDial = (-1 * TinygDriver.getInstance().machine.getJoggingIncrementByAxis(_axis)); //Invert this value by multiplying by -1
}
//X Axis Jogging Movement
} else if (_kc.equals(KeyCode.RIGHT) || _kc.equals(KeyCode.LEFT)) {
//This is a X Axis Jog Action
_axis = "X"; //Set the axis for this jog movment
if (keyEvent.getCode().equals(KeyCode.LEFT)) {
jogDial = (-1 * TinygDriver.getInstance().machine.getJoggingIncrementByAxis(_axis));
} else if (keyEvent.getCode().equals(KeyCode.RIGHT)) {
jogDial = TinygDriver.getInstance().machine.getJoggingIncrementByAxis(_axis); //Invert this value by multiplying by -1
}
//Z Axis Jogging Movement
} else if (_kc.equals(KeyCode.MINUS) || (_kc.equals(KeyCode.EQUALS))) {
_axis = "Z";
if (keyEvent.getCode().equals(KeyCode.MINUS)) {
jogDial = (-1 * TinygDriver.getInstance().machine.getJoggingIncrementByAxis(_axis));
} else if (keyEvent.getCode().equals(KeyCode.EQUALS)) {
jogDial = TinygDriver.getInstance().machine.getJoggingIncrementByAxis(_axis); //Invert this value by multiplying by -1