Skip to content

Commit 11d0af0

Browse files
committed
Added support for space and numbers to incremental search.
1 parent 5a153c4 commit 11d0af0

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

core/src/main/java/emu/joric/HomeScreen.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,12 +505,23 @@ else if ((keycode == Keys.ENTER) ||
505505
}
506506
}
507507
}
508-
else if ((keycode >= Keys.A) && (keycode <= Keys.Z)) {
508+
else if (((keycode >= Keys.A) && (keycode <= Keys.Z)) ||
509+
((keycode >= Keys.NUM_0) && (keycode <= Keys.NUM_9)) ||
510+
(keycode == Keys.SPACE)) {
511+
509512
if ((TimeUtils.millis() - lastKeyPress) > 1000) {
510513
searchString = "";
511514
}
512515

513-
searchString += ((char)(keycode + 36));
516+
if ((keycode >= Keys.A) && (keycode <= Keys.Z)) {
517+
searchString += ((char)(keycode + 36));
518+
}
519+
else if ((keycode >= Keys.NUM_0) && (keycode <= Keys.NUM_9)) {
520+
searchString += ((char)(keycode + 41));
521+
}
522+
else if (keycode == Keys.SPACE) {
523+
searchString += " ";
524+
}
514525

515526
// Shortcut keys for accessing games that start with each letter.
516527
// Keys.A is 29, Keys.Z is 54. ASCII is A=65, Z=90. So we add 36.

0 commit comments

Comments
 (0)