@@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed not being able to type "e" in Grid search box.
|
||||
|
||||
## [1.12.2] - 2023-07-05
|
||||
|
||||
### Fixed
|
||||
|
@@ -81,7 +81,7 @@ public class DetectorScreen extends BaseScreen<DetectorContainerMenu> {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (amountField.keyPressed(key, scanCode, modifiers)) {
|
||||
if (amountField.keyPressed(key, scanCode, modifiers) || amountField.canConsumeInput()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -101,7 +101,7 @@ public class FilterScreen extends BaseScreen<FilterContainerMenu> {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (nameField.keyPressed(key, scanCode, modifiers)) {
|
||||
if (nameField.keyPressed(key, scanCode, modifiers) || nameField.canConsumeInput()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -686,7 +686,6 @@ public class GridScreen extends BaseScreen<GridContainerMenu> implements IScreen
|
||||
if (searchField.keyPressed(key, scanCode, modifiers)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.keyPressed(key, scanCode, modifiers);
|
||||
}
|
||||
|
||||
|
@@ -65,57 +65,47 @@ public class SearchWidget extends EditBox {
|
||||
|
||||
@Override
|
||||
public boolean keyPressed(int keyCode, int scanCode, int modifier) {
|
||||
boolean result = super.keyPressed(keyCode, scanCode, modifier);
|
||||
if (super.keyPressed(keyCode, scanCode, modifier)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isFocused()) {
|
||||
if (keyCode == GLFW.GLFW_KEY_UP) {
|
||||
updateHistory(-1);
|
||||
|
||||
result = true;
|
||||
} else if (keyCode == GLFW.GLFW_KEY_DOWN) {
|
||||
updateHistory(1);
|
||||
|
||||
result = true;
|
||||
} else if (keyCode == GLFW.GLFW_KEY_ENTER || keyCode == GLFW.GLFW_KEY_KP_ENTER) {
|
||||
saveHistory();
|
||||
|
||||
if (canLoseFocus) {
|
||||
setFocused(false);
|
||||
}
|
||||
|
||||
result = true;
|
||||
} else if (keyCode == GLFW.GLFW_KEY_ESCAPE) {
|
||||
saveHistory();
|
||||
|
||||
if (!canLoseFocus) {
|
||||
// If we can't lose focus,
|
||||
// and we press escape,
|
||||
// we unfocus ourselves,
|
||||
// and close the screen immediately.
|
||||
setFocused(false);
|
||||
|
||||
result = false; // Bubble the event up to the screen.
|
||||
return false; // Bubble the event up to the screen.
|
||||
} else {
|
||||
// If we can lose focus,
|
||||
// and we press escape,
|
||||
// we unfocus ourselves.
|
||||
// On the next escape press, the screen will close.
|
||||
setFocused(false);
|
||||
|
||||
result = true;
|
||||
return true; // Swallow
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (BaseScreen.isKeyDown(RSKeyBindings.FOCUS_SEARCH_BAR) && canLoseFocus) {
|
||||
setFocused(!isFocused());
|
||||
|
||||
saveHistory();
|
||||
|
||||
result = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
return result;
|
||||
return isFocused() && canConsumeInput() && keyCode != GLFW.GLFW_KEY_ESCAPE;
|
||||
}
|
||||
|
||||
private void updateHistory(int delta) {
|
||||
|
Reference in New Issue
Block a user