I'm using the GuiScreen keyTyped function in an extended class, because the search bar is in a Gui. This is the code that I currently have
public void keyTyped(char typedChar, int keyCode) {
if (focus) {
if (keyCode == 28) {
focus = false;
} else if (keyCode == 14) {
if (!typed.isEmpty()) {
typed = typed.substring(0, typed.length() - 1);
}
} else if (ChatAllowedCharacters.isAllowedCharacter(typedChar)) {
typed += typedChar;
}
}
}
Hello! I'm making a search bar for my mod and I was wondering where I can find how to implement a ctrl + a to select all and being able to hold delete. I'm currently using an integer to store my keyCodes and I was wondering if there was a way to check if a combination of keyCodes are typed and if you can hold them down.