Skip to content
Snippets Groups Projects
Commit 82cb48eb authored by Jason Dittmer (jcd763)'s avatar Jason Dittmer (jcd763)
Browse files

Started keyValueMap, changed UI functions to use map values instead of strings.

parent 207d7d90
No related branches found
No related tags found
3 merge requests!45Prototype to Master for Milestone 5,!40Feature rebind keys,!38Add UI to feature branch
......@@ -17,6 +17,9 @@ public class KeybindView extends Pane {
TextField keyAction = new TextField();
//Options for selecting keys
OptionsList lists = new OptionsList();
//Mapping of key selections and key code integers
keyValueMap keyValueMap = new keyValueMap();
public KeybindView() {
this.setStyle("-fx-background-color: #99aab5;");
keyToBind.setLayoutX(60);
......@@ -49,12 +52,23 @@ public class KeybindView extends Pane {
}
public String getKeyToBind() {
return keyToBind.getText();
/**
* Returns an Integer value for the Windows key code for the string representation of a key.
* Corresponds to the key which is being bound
* @return an Integer value for the Windows key code for the string representation of a key
*/
public Integer getKeyToBind() {
return keyValueMap.getKeyCode(keyToBind.getText());
}
/**
* Returns an Integer value for the Windows key code for the string representation of a key.
* Corresponds to the resulting action when the bound key is pressed
* @return an Integer value for the Windows key code for the string representation of a key
*/
public Integer getKeyAction() {
public String getKeyAction() {
return keyAction.getText();
return keyValueMap.getKeyCode(keyAction.getText());
}
}
......@@ -14,6 +14,7 @@ public class mainScreen extends Pane {
Stage primaryStage = new Stage();
Scene mainScreenScene = new Scene(this, 800, 800);
public mainScreen() {
this.setStyle("-fx-background-color: #99aab5;");
primaryStage.setTitle("");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment