From 4dc8b34557889109f349ac41818571658994e55b Mon Sep 17 00:00:00 2001 From: yugecin Date: Sat, 21 Jan 2017 13:17:22 +0100 Subject: [PATCH] fix not being able to enter O in the search bar in songmenu --- src/itdelatrisu/opsu/states/SongMenu.java | 35 +++++++++++------------ 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/src/itdelatrisu/opsu/states/SongMenu.java b/src/itdelatrisu/opsu/states/SongMenu.java index d1b98ac6..f8743200 100644 --- a/src/itdelatrisu/opsu/states/SongMenu.java +++ b/src/itdelatrisu/opsu/states/SongMenu.java @@ -1171,28 +1171,25 @@ public class SongMenu extends ComplexOpsuState { case Input.KEY_PRIOR: changeIndex(-MAX_SONG_BUTTONS); return true; - case Input.KEY_O: - if (input.isKeyDown(Input.KEY_LCONTROL) || input.isKeyDown(Input.KEY_RCONTROL)) { - optionsOverlay.show(); - } + } + if (key == Input.KEY_O && (input.isKeyDown(Input.KEY_LCONTROL) || input.isKeyDown(Input.KEY_RCONTROL))) { + optionsOverlay.show(); return true; - default: - // wait for user to finish typing - // TODO: accept all characters (current conditions are from TextField class) - if ((c > 31 && c < 127) || key == Input.KEY_BACK) { - searchTimer = 0; - searchTextField.keyPressed(key, c); - int textLength = searchTextField.getText().length(); - if (lastSearchTextLength != textLength) { - if (key == Input.KEY_BACK) { - if (textLength == 0) - searchTransitionTimer = 0; - } else if (textLength == 1) + } + // wait for user to finish typing + // TODO: accept all characters (current conditions are from TextField class) + if ((c > 31 && c < 127) || key == Input.KEY_BACK) { + searchTimer = 0; + searchTextField.keyPressed(key, c); + int textLength = searchTextField.getText().length(); + if (lastSearchTextLength != textLength) { + if (key == Input.KEY_BACK) { + if (textLength == 0) searchTransitionTimer = 0; - lastSearchTextLength = textLength; - } + } else if (textLength == 1) + searchTransitionTimer = 0; + lastSearchTextLength = textLength; } - return true; } return true; }