Skip to content
Snippets Groups Projects
Commit 903c15e6 authored by Dallin Nickel (djn011)'s avatar Dallin Nickel (djn011)
Browse files

Unregister keys after removing

parent 0465ddb6
No related branches found
No related tags found
2 merge requests!65Prototype,!52Feature addmacros
package Controller;
import model.Hotkey;
import model.OSInterface;
import java.util.ArrayList;
public class Action {
/**
* a list of keycodes which need to be sent
*/
ArrayList<Integer> keyCodes;
/**
* a constructor to create a new Action list
* @param keys a list of keyCodes
*/
public Action(ArrayList<Integer> keys){
this.keyCodes = keys;
}
/**
* calls all the keycodes in the list
*/
public void preformAction(){
for(Integer i:keyCodes){
OSInterface.getInstance().sendKey(i, true);
}
}
/**
* return all the keys in the action
* @return keys in the action
......@@ -35,4 +19,14 @@ public class Action {
public ArrayList<Integer> getKeys(){
return this.keyCodes;
}
/**
* calls all the keycodes in the list
*/
public void preformAction(){
//for each keycode in the list, preform it
for(Integer keyCode:this.getKeys()){
OSInterface.getInstance().sendKey(keyCode, true);
}
}
}
\ No newline at end of file
......@@ -391,6 +391,7 @@ public class MainScreen extends Pane {
remove.setOnAction(e -> {
dict.remove(i);
primaryStage.setScene(mainScreenScene);
OSInterface.getInstance().unregisterHotkey(i);
});
BV.getChildren().add(remove);
}
......
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