Fixes mouse handling for right-clicks to clear the search box and middle-click for crafting. (#4505)

This commit is contained in:
shartte
2020-07-26 16:30:53 +02:00
committed by GitHub
parent 774f88ee90
commit 59e40ccbd9
4 changed files with 21 additions and 28 deletions
@@ -58,22 +58,6 @@ public class AETextField extends TextFieldWidget {
this._fontPad = (int) fontRenderer.getCharWidth('_');
}
@Override
public boolean mouseClicked(final double xPos, final double yPos, final int button) {
// super will always return false, if button is != 0, however super should still
// be called.
if (!super.mouseClicked(xPos, yPos, button) && button == 0) {
return false;
}
final boolean requiresFocus = this.isMouseOver(xPos, yPos);
if (!this.isFocused()) {
this.setFocused2(requiresFocus);
}
return true;
}
public void selectAll() {
this.setCursorPosition(0);
this.setSelectionPos(this.getMaxStringLength());