Program: 171363
Project: 171363
Buggy source:
private void setUpButtons(){
  actionKeyPressed=new EventHandler<KeyEvent>(){
    private Map.Entry<KeyboardAction,KeyCodeWithModifiers> findExistingBinding(    Map<KeyboardAction,KeyCodeWithModifiers> bindings,    KeyEvent lookingFor){
      return bindings.entrySet().stream().filter(entry -> entry.getValue() != null).filter(entry -> entry.getValue().matches(lookingFor)).findFirst().orElse(null);
    }
    private void printAlreadyExistingBinding(    String primarySecondary,    String actionName,    String eventCodeName){
      Main.game.getTextStartStringBuilder().append("String_Node_Str" + "String_Node_Str" + Colour.GENERIC_BAD.toWebHexString() + "String_Node_Str"+ eventCodeName+ "String_Node_Str"+ primarySecondary+ "String_Node_Str"+ actionName+ "String_Node_Str"+ "String_Node_Str");
      Main.game.setContent(new Response("String_Node_Str","String_Node_Str",Main.game.getCurrentDialogueNode()));
    }
    private boolean handleExistingBindings(    Map<KeyboardAction,KeyCodeWithModifiers> bindings,    KeyEvent lookingFor,    String primarySecondary){
      Map.Entry<KeyboardAction,KeyCodeWithModifiers> existingBinding=findExistingBinding(bindings,lookingFor);
      boolean hasExistingBinding=existingBinding != null;
      if (hasExistingBinding) {
        actionToBind=null;
        printAlreadyExistingBinding(primarySecondary,existingBinding.getKey().getName(),existingBinding.getValue().getFullName());
      }
      return hasExistingBinding;
    }
    public void handle(    KeyEvent event){
      if (allowInput) {
        if (Main.game.getCurrentDialogueNode() == OptionsDialogue.KEYBINDS) {
          if (actionToBind != null) {
            KeyCode eventCode=event.getCode();
            if (eventCode == KeyCode.SHIFT || eventCode == KeyCode.CONTROL) {
              return;
            }
            if (handleExistingBindings(Main.getProperties().hotkeyMapPrimary,event,"String_Node_Str") || handleExistingBindings(Main.getProperties().hotkeyMapSecondary,event,"String_Node_Str")) {
              return;
            }
            KeyCodeWithModifiers newBinding=new KeyCodeWithModifiers(eventCode,event.isControlDown(),event.isShiftDown());
            if (primaryBinding)             Main.getProperties().hotkeyMapPrimary.put(actionToBind,newBinding);
 else             Main.getProperties().hotkeyMapSecondary.put(actionToBind,newBinding);
            actionToBind=null;
            Main.saveProperties();
            Main.game.setContent(new Response("String_Node_Str","String_Node_Str",Main.game.getCurrentDialogueNode()));
            return;
          }
        }
 else {
          actionToBind=null;
        }
        if (!buttonsPressed.contains(event.getCode())) {
          buttonsPressed.add(event.getCode());
          for (int i=4; i > 0; i--)           lastKeys[i]=lastKeys[i - 1];
          lastKeys[0]=event.getCode();
          checkLastKeys();
          if (event.getCode() == KeyCode.END) {
          }
          if (keyEventMatchesBindings(KeyboardAction.MENU,event))           openOptions();
          if (keyEventMatchesBindings(KeyboardAction.MOVE_NORTH,event)) {
            if (!Main.game.getCurrentDialogueNode().isTravelDisabled() && !event.isControlDown()) {
              moveNorth();
            }
 else {
              Main.game.responseNavigationUp();
            }
          }
          if (keyEventMatchesBindings(KeyboardAction.MOVE_WEST,event)) {
            if (!Main.game.getCurrentDialogueNode().isTravelDisabled() && !event.isControlDown()) {
              moveWest();
            }
 else {
              Main.game.responseNavigationLeft();
            }
          }
          if (keyEventMatchesBindings(KeyboardAction.MOVE_SOUTH,event)) {
            if (!Main.game.getCurrentDialogueNode().isTravelDisabled() && !event.isControlDown()) {
              moveSouth();
            }
 else {
              Main.game.responseNavigationDown();
            }
          }
          if (keyEventMatchesBindings(KeyboardAction.MOVE_EAST,event)) {
            if (!Main.game.getCurrentDialogueNode().isTravelDisabled() && !event.isControlDown()) {
              moveEast();
            }
 else {
              Main.game.responseNavigationRight();
            }
          }
          if (keyEventMatchesBindings(KeyboardAction.QUICKSAVE,event)) {
            Main.quickSaveGame();
          }
          if (keyEventMatchesBindings(KeyboardAction.QUICKLOAD,event)) {
            Main.quickLoadGame();
          }
          boolean allowInput=true;
          if (Main.game.getCurrentDialogueNode() == CharacterCreation.CHOOSE_NAME || Main.game.getCurrentDialogueNode() == CityHall.CITY_HALL_NAME_CHANGE_FORM) {
            if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str")) {
              allowInput=false;
              if (event.getCode() == KeyCode.ENTER) {
                Main.game.setContent(1);
              }
            }
            if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str")) {
              allowInput=false;
              if (event.getCode() == KeyCode.ENTER) {
                Main.game.setContent(1);
              }
            }
          }
          if (Main.game.getCurrentDialogueNode() == LilayaHomeGeneric.ROOM_UPGRADES) {
            if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str")) {
              allowInput=false;
              if (event.getCode() == KeyCode.ENTER) {
                boolean unsuitableName=false;
                if (Main.mainController.getWebEngine().executeScript("String_Node_Str") != null) {
                  Main.mainController.getWebEngine().executeScript("String_Node_Str");
                  if (Main.mainController.getWebEngine().getDocument() != null) {
                    if (Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent().length() < 1 || Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent().length() > 32)                     unsuitableName=true;
 else {
                      unsuitableName=false;
                    }
                  }
                  if (!unsuitableName) {
                    Main.game.setContent(new Response("String_Node_Str","String_Node_Str",Main.game.getCurrentDialogueNode()){
                      @Override public void effects(){
                        Main.game.getPlayerCell().getPlace().setName(Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent());
                      }
                    }
);
                  }
                }
              }
            }
          }
          if (Main.game.getCurrentDialogueNode() == CityHall.CITY_HALL_NAME_CHANGE_FORM) {
            if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str")) {
              allowInput=false;
              if (event.getCode() == KeyCode.ENTER) {
                Main.game.setContent(1);
              }
            }
          }
          if (Main.game.getCurrentDialogueNode() == OptionsDialogue.SAVE_LOAD) {
            if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str")) {
              allowInput=false;
              if (event.getCode() == KeyCode.ENTER) {
                Main.mainController.getWebEngine().executeScript("String_Node_Str");
                Main.saveGame(Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent(),false);
              }
            }
          }
          if (Main.game.getCurrentDialogueNode() == MiscDialogue.SLAVE_MANAGEMENT_DETAILED_VIEW) {
            if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str")) {
              allowInput=false;
              if (event.getCode() == KeyCode.ENTER) {
                boolean unsuitableName=false;
                if (Main.mainController.getWebEngine().executeScript("String_Node_Str") != null) {
                  Main.mainController.getWebEngine().executeScript("String_Node_Str");
                  if (Main.mainController.getWebEngine().getDocument() != null) {
                    if (Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent().length() < 1 || Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent().length() > 32)                     unsuitableName=true;
 else {
                      unsuitableName=false;
                    }
                  }
                  if (!unsuitableName) {
                    Main.game.setContent(new Response("String_Node_Str","String_Node_Str",Main.game.getCurrentDialogueNode()){
                      @Override public void effects(){
                        Main.game.getDialogueFlags().slaveryManagerSlaveSelected.setPlayerPetName(Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent());
                      }
                    }
);
                  }
                }
              }
            }
            if (((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str"))) {
              allowInput=false;
              if (event.getCode() == KeyCode.ENTER) {
                boolean unsuitableName=false;
                if (Main.mainController.getWebEngine().executeScript("String_Node_Str") != null) {
                  Main.mainController.getWebEngine().executeScript("String_Node_Str");
                  if (Main.mainController.getWebEngine().getDocument() != null) {
                    if (Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent().length() < 1 || Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent().length() > 32)                     unsuitableName=true;
 else {
                      unsuitableName=false;
                    }
                  }
                  if (!unsuitableName) {
                    Main.game.setContent(new Response("String_Node_Str","String_Node_Str",Main.game.getCurrentDialogueNode()){
                      @Override public void effects(){
                        Main.game.getDialogueFlags().slaveryManagerSlaveSelected.setName(new NameTriplet(Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent()));
                      }
                    }
);
                  }
                }
              }
            }
          }
          if (((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str"))) {
            allowInput=false;
          }
          if (Main.game.getCurrentDialogueNode() == OptionsDialogue.OPTIONS_PRONOUNS) {
            for (            GenderPronoun gp : GenderPronoun.values()) {
              if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str" + gp + "String_Node_Str") || (boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str" + gp + "String_Node_Str"))               allowInput=false;
            }
            for (            GenderNames genderName : GenderNames.values()) {
              if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str" + genderName + "String_Node_Str") || (boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str" + genderName + "String_Node_Str") || (boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str" + genderName + "String_Node_Str"))               allowInput=false;
            }
          }
          if (Main.game.getCurrentDialogueNode() == GenericDialogue.PARSER) {
            if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str"))             allowInput=false;
          }
          if (allowInput) {
            if (keyEventMatchesBindings(KeyboardAction.INVENTORY,event))             openInventory();
            if (keyEventMatchesBindings(KeyboardAction.JOURNAL,event))             openPhone();
            if (keyEventMatchesBindings(KeyboardAction.CHARACTERS,event))             openCharactersPresent(null);
            if (keyEventMatchesBindings(KeyboardAction.ZOOM,event))             zoomMap();
            if (keyEventMatchesBindings(KeyboardAction.SCROLL_UP,event))             Main.mainController.getWebEngine().executeScript("String_Node_Str");
            if (keyEventMatchesBindings(KeyboardAction.SCROLL_DOWN,event))             Main.mainController.getWebEngine().executeScript("String_Node_Str");
            KeyboardAction[] keyboardActionsForResponses={KeyboardAction.RESPOND_0,KeyboardAction.RESPOND_1,KeyboardAction.RESPOND_2,KeyboardAction.RESPOND_3,KeyboardAction.RESPOND_4,KeyboardAction.RESPOND_5,KeyboardAction.RESPOND_6,KeyboardAction.RESPOND_7,KeyboardAction.RESPOND_8,KeyboardAction.RESPOND_9,KeyboardAction.RESPOND_10,KeyboardAction.RESPOND_11,KeyboardAction.RESPOND_12,KeyboardAction.RESPOND_13,KeyboardAction.RESPOND_14};
            for (int i=0; i < keyboardActionsForResponses.length; i++) {
              if (keyEventMatchesBindings(keyboardActionsForResponses[i],event)) {
                processResponse(i);
              }
            }
            if (keyEventMatchesBindings(KeyboardAction.MENU_SELECT,event)) {
              Main.game.setContent(Main.game.getResponsePointer());
            }
          }
          if (keyEventMatchesBindings(KeyboardAction.RESPOND_NEXT_PAGE,event)) {
            if (Main.game.isHasNextResponsePage()) {
              Main.game.setResponsePage(Main.game.getResponsePage() + 1);
              Main.game.setResponses(Main.game.getCurrentDialogueNode());
            }
          }
          if (keyEventMatchesBindings(KeyboardAction.RESPOND_PREVIOUS_PAGE,event)) {
            if (Main.game.getResponsePage() != 0) {
              Main.game.setResponsePage(Main.game.getResponsePage() - 1);
              Main.game.setResponses(Main.game.getCurrentDialogueNode());
            }
          }
        }
      }
    }
  }
;
  actionKeyReleased=new EventHandler<KeyEvent>(){
    public void handle(    KeyEvent event){
      if (buttonsPressed.contains(event.getCode())) {
        buttonsPressed.remove(event.getCode());
      }
    }
  }
;
  Main.primaryStage.addEventFilter(KeyEvent.KEY_PRESSED,actionKeyPressed);
  Main.primaryStage.addEventFilter(KeyEvent.KEY_RELEASED,actionKeyReleased);
}

Fixed version (ground truth):
private void setUpButtons(){
  actionKeyPressed=new EventHandler<KeyEvent>(){
    private Map.Entry<KeyboardAction,KeyCodeWithModifiers> findExistingBinding(    Map<KeyboardAction,KeyCodeWithModifiers> bindings,    KeyEvent lookingFor){
      return bindings.entrySet().stream().filter(entry -> entry.getValue() != null).filter(entry -> entry.getValue().matches(lookingFor)).findFirst().orElse(null);
    }
    private void printAlreadyExistingBinding(    String primarySecondary,    String actionName,    String eventCodeName){
      Main.game.getTextStartStringBuilder().append("String_Node_Str" + "String_Node_Str" + Colour.GENERIC_BAD.toWebHexString() + "String_Node_Str"+ eventCodeName+ "String_Node_Str"+ primarySecondary+ "String_Node_Str"+ actionName+ "String_Node_Str"+ "String_Node_Str");
      Main.game.setContent(new Response("String_Node_Str","String_Node_Str",Main.game.getCurrentDialogueNode()));
    }
    private boolean handleExistingBindings(    Map<KeyboardAction,KeyCodeWithModifiers> bindings,    KeyEvent lookingFor,    String primarySecondary){
      Map.Entry<KeyboardAction,KeyCodeWithModifiers> existingBinding=findExistingBinding(bindings,lookingFor);
      boolean hasExistingBinding=existingBinding != null;
      if (hasExistingBinding) {
        actionToBind=null;
        printAlreadyExistingBinding(primarySecondary,existingBinding.getKey().getName(),existingBinding.getValue().getFullName());
      }
      return hasExistingBinding;
    }
    public void handle(    KeyEvent event){
      if (allowInput) {
        if (Main.game.getCurrentDialogueNode() == OptionsDialogue.KEYBINDS) {
          if (actionToBind != null) {
            KeyCode eventCode=event.getCode();
            if (eventCode == KeyCode.SHIFT || eventCode == KeyCode.CONTROL) {
              return;
            }
            if (handleExistingBindings(Main.getProperties().hotkeyMapPrimary,event,"String_Node_Str") || handleExistingBindings(Main.getProperties().hotkeyMapSecondary,event,"String_Node_Str")) {
              return;
            }
            KeyCodeWithModifiers newBinding=new KeyCodeWithModifiers(eventCode,event.isControlDown(),event.isShiftDown());
            if (primaryBinding)             Main.getProperties().hotkeyMapPrimary.put(actionToBind,newBinding);
 else             Main.getProperties().hotkeyMapSecondary.put(actionToBind,newBinding);
            actionToBind=null;
            Main.saveProperties();
            Main.game.setContent(new Response("String_Node_Str","String_Node_Str",Main.game.getCurrentDialogueNode()));
            return;
          }
        }
 else {
          actionToBind=null;
        }
        if (!buttonsPressed.contains(event.getCode())) {
          buttonsPressed.add(event.getCode());
          for (int i=4; i > 0; i--)           lastKeys[i]=lastKeys[i - 1];
          lastKeys[0]=event.getCode();
          checkLastKeys();
          if (event.getCode() == KeyCode.END) {
            System.out.println(ItemType.BOOK_CAT_MORPH.getId());
          }
          if (keyEventMatchesBindings(KeyboardAction.MENU,event))           openOptions();
          if (keyEventMatchesBindings(KeyboardAction.MOVE_NORTH,event)) {
            if (!Main.game.getCurrentDialogueNode().isTravelDisabled() && !event.isControlDown()) {
              moveNorth();
            }
 else {
              Main.game.responseNavigationUp();
            }
          }
          if (keyEventMatchesBindings(KeyboardAction.MOVE_WEST,event)) {
            if (!Main.game.getCurrentDialogueNode().isTravelDisabled() && !event.isControlDown()) {
              moveWest();
            }
 else {
              Main.game.responseNavigationLeft();
            }
          }
          if (keyEventMatchesBindings(KeyboardAction.MOVE_SOUTH,event)) {
            if (!Main.game.getCurrentDialogueNode().isTravelDisabled() && !event.isControlDown()) {
              moveSouth();
            }
 else {
              Main.game.responseNavigationDown();
            }
          }
          if (keyEventMatchesBindings(KeyboardAction.MOVE_EAST,event)) {
            if (!Main.game.getCurrentDialogueNode().isTravelDisabled() && !event.isControlDown()) {
              moveEast();
            }
 else {
              Main.game.responseNavigationRight();
            }
          }
          if (keyEventMatchesBindings(KeyboardAction.QUICKSAVE,event)) {
            Main.quickSaveGame();
          }
          if (keyEventMatchesBindings(KeyboardAction.QUICKLOAD,event)) {
            Main.quickLoadGame();
          }
          boolean allowInput=true;
          if (Main.game.getCurrentDialogueNode() == CharacterCreation.CHOOSE_NAME || Main.game.getCurrentDialogueNode() == CityHall.CITY_HALL_NAME_CHANGE_FORM) {
            if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str")) {
              allowInput=false;
              if (event.getCode() == KeyCode.ENTER) {
                Main.game.setContent(1);
              }
            }
            if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str")) {
              allowInput=false;
              if (event.getCode() == KeyCode.ENTER) {
                Main.game.setContent(1);
              }
            }
          }
          if (Main.game.getCurrentDialogueNode() == LilayaHomeGeneric.ROOM_UPGRADES) {
            if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str")) {
              allowInput=false;
              if (event.getCode() == KeyCode.ENTER) {
                boolean unsuitableName=false;
                if (Main.mainController.getWebEngine().executeScript("String_Node_Str") != null) {
                  Main.mainController.getWebEngine().executeScript("String_Node_Str");
                  if (Main.mainController.getWebEngine().getDocument() != null) {
                    if (Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent().length() < 1 || Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent().length() > 32)                     unsuitableName=true;
 else {
                      unsuitableName=false;
                    }
                  }
                  if (!unsuitableName) {
                    Main.game.setContent(new Response("String_Node_Str","String_Node_Str",Main.game.getCurrentDialogueNode()){
                      @Override public void effects(){
                        Main.game.getPlayerCell().getPlace().setName(Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent());
                      }
                    }
);
                  }
                }
              }
            }
          }
          if (Main.game.getCurrentDialogueNode() == CityHall.CITY_HALL_NAME_CHANGE_FORM) {
            if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str")) {
              allowInput=false;
              if (event.getCode() == KeyCode.ENTER) {
                Main.game.setContent(1);
              }
            }
          }
          if (Main.game.getCurrentDialogueNode() == OptionsDialogue.SAVE_LOAD) {
            if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str")) {
              allowInput=false;
              if (event.getCode() == KeyCode.ENTER) {
                Main.mainController.getWebEngine().executeScript("String_Node_Str");
                Main.saveGame(Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent(),false);
              }
            }
          }
          if (Main.game.getCurrentDialogueNode() == MiscDialogue.SLAVE_MANAGEMENT_DETAILED_VIEW) {
            if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str")) {
              allowInput=false;
              if (event.getCode() == KeyCode.ENTER) {
                boolean unsuitableName=false;
                if (Main.mainController.getWebEngine().executeScript("String_Node_Str") != null) {
                  Main.mainController.getWebEngine().executeScript("String_Node_Str");
                  if (Main.mainController.getWebEngine().getDocument() != null) {
                    if (Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent().length() < 1 || Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent().length() > 32)                     unsuitableName=true;
 else {
                      unsuitableName=false;
                    }
                  }
                  if (!unsuitableName) {
                    Main.game.setContent(new Response("String_Node_Str","String_Node_Str",Main.game.getCurrentDialogueNode()){
                      @Override public void effects(){
                        Main.game.getDialogueFlags().slaveryManagerSlaveSelected.setPlayerPetName(Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent());
                      }
                    }
);
                  }
                }
              }
            }
            if (((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str"))) {
              allowInput=false;
              if (event.getCode() == KeyCode.ENTER) {
                boolean unsuitableName=false;
                if (Main.mainController.getWebEngine().executeScript("String_Node_Str") != null) {
                  Main.mainController.getWebEngine().executeScript("String_Node_Str");
                  if (Main.mainController.getWebEngine().getDocument() != null) {
                    if (Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent().length() < 1 || Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent().length() > 32)                     unsuitableName=true;
 else {
                      unsuitableName=false;
                    }
                  }
                  if (!unsuitableName) {
                    Main.game.setContent(new Response("String_Node_Str","String_Node_Str",Main.game.getCurrentDialogueNode()){
                      @Override public void effects(){
                        Main.game.getDialogueFlags().slaveryManagerSlaveSelected.setName(new NameTriplet(Main.mainController.getWebEngine().getDocument().getElementById("String_Node_Str").getTextContent()));
                      }
                    }
);
                  }
                }
              }
            }
          }
          if (((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str"))) {
            allowInput=false;
          }
          if (Main.game.getCurrentDialogueNode() == OptionsDialogue.OPTIONS_PRONOUNS) {
            for (            GenderPronoun gp : GenderPronoun.values()) {
              if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str" + gp + "String_Node_Str") || (boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str" + gp + "String_Node_Str"))               allowInput=false;
            }
            for (            GenderNames genderName : GenderNames.values()) {
              if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str" + genderName + "String_Node_Str") || (boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str" + genderName + "String_Node_Str") || (boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str" + genderName + "String_Node_Str"))               allowInput=false;
            }
          }
          if (Main.game.getCurrentDialogueNode() == GenericDialogue.PARSER) {
            if ((boolean)Main.mainController.getWebEngine().executeScript("String_Node_Str"))             allowInput=false;
          }
          if (allowInput) {
            if (keyEventMatchesBindings(KeyboardAction.INVENTORY,event))             openInventory();
            if (keyEventMatchesBindings(KeyboardAction.JOURNAL,event))             openPhone();
            if (keyEventMatchesBindings(KeyboardAction.CHARACTERS,event))             openCharactersPresent(null);
            if (keyEventMatchesBindings(KeyboardAction.ZOOM,event))             zoomMap();
            if (keyEventMatchesBindings(KeyboardAction.SCROLL_UP,event))             Main.mainController.getWebEngine().executeScript("String_Node_Str");
            if (keyEventMatchesBindings(KeyboardAction.SCROLL_DOWN,event))             Main.mainController.getWebEngine().executeScript("String_Node_Str");
            KeyboardAction[] keyboardActionsForResponses={KeyboardAction.RESPOND_0,KeyboardAction.RESPOND_1,KeyboardAction.RESPOND_2,KeyboardAction.RESPOND_3,KeyboardAction.RESPOND_4,KeyboardAction.RESPOND_5,KeyboardAction.RESPOND_6,KeyboardAction.RESPOND_7,KeyboardAction.RESPOND_8,KeyboardAction.RESPOND_9,KeyboardAction.RESPOND_10,KeyboardAction.RESPOND_11,KeyboardAction.RESPOND_12,KeyboardAction.RESPOND_13,KeyboardAction.RESPOND_14};
            for (int i=0; i < keyboardActionsForResponses.length; i++) {
              if (keyEventMatchesBindings(keyboardActionsForResponses[i],event)) {
                processResponse(i);
              }
            }
            if (keyEventMatchesBindings(KeyboardAction.MENU_SELECT,event)) {
              Main.game.setContent(Main.game.getResponsePointer());
            }
          }
          if (keyEventMatchesBindings(KeyboardAction.RESPOND_NEXT_PAGE,event)) {
            if (Main.game.isHasNextResponsePage()) {
              Main.game.setResponsePage(Main.game.getResponsePage() + 1);
              Main.game.setResponses(Main.game.getCurrentDialogueNode());
            }
          }
          if (keyEventMatchesBindings(KeyboardAction.RESPOND_PREVIOUS_PAGE,event)) {
            if (Main.game.getResponsePage() != 0) {
              Main.game.setResponsePage(Main.game.getResponsePage() - 1);
              Main.game.setResponses(Main.game.getCurrentDialogueNode());
            }
          }
        }
      }
    }
  }
;
  actionKeyReleased=new EventHandler<KeyEvent>(){
    public void handle(    KeyEvent event){
      if (buttonsPressed.contains(event.getCode())) {
        buttonsPressed.remove(event.getCode());
      }
    }
  }
;
  Main.primaryStage.addEventFilter(KeyEvent.KEY_PRESSED,actionKeyPressed);
  Main.primaryStage.addEventFilter(KeyEvent.KEY_RELEASED,actionKeyReleased);
}