Fixed send button traversable issue.

- removed sensitive characters.

#story[1278] #pair[hyi25, zyt10]
This commit is contained in:
Zhi You Tan
2017-09-25 17:06:36 +13:00
parent 191b818e38
commit 0e93be7b36
4 changed files with 10 additions and 4 deletions
@@ -23,6 +23,8 @@ public class KeyBindingDialogController implements Initializable {
//--------FXML BEGIN--------//
@FXML
private Label keyBindingDialogHeader;
@FXML
private Label closeLabel;
@FXML
private JFXButton zoomInbtn;
@@ -77,6 +79,9 @@ public class KeyBindingDialogController implements Initializable {
});
closeLabel.setOnMouseClicked(event -> ViewManager.getInstance().closeKeyBindingDialog());
keyBindingDialogHeader.setFocusTraversable(true);
keyBindingDialogHeader.requestFocus();
}
/**
@@ -153,14 +158,15 @@ public class KeyBindingDialogController implements Initializable {
* @param button
*/
private void keyPressed(KeyEvent event, Button button) {
event.consume();
KeyAction buttonAction = buttonActionMap.get(button);
if (gameKeyBind.bindKeyToAction(event.getCode(), buttonAction)) {
showSnackBar(button.getId() + " is set to " + event.getCode().getName(), false);
button.setText(gameKeyBind.getKeyCode(buttonAction).getName());
} else {
loadKeyBind();
showSnackBar(event.getCode().getName() + " is already in use", true);
}
event.consume();
}
/**