@@ -52,6 +52,7 @@ public class ContainerScreenLogicProgrammerBase<C extends ContainerLogicProgramm
52
52
protected SubGuiOperatorInfo operatorInfoPattern = null ;
53
53
protected boolean firstInit = true ;
54
54
protected int relativeStep = -1 ;
55
+ protected boolean swallowNextCharacter = false ;
55
56
56
57
public ContainerScreenLogicProgrammerBase (C container , Inventory playerInventory , Component title ) {
57
58
super (container , playerInventory , title );
@@ -270,10 +271,12 @@ protected boolean handleKeyCode(int keyCode, int scanCode) {
270
271
if (ClientProxy .FOCUS_LP_SEARCH .isActiveAndMatches (inputCode )) {
271
272
// Focus search field
272
273
setSearchFieldFocussed (true );
274
+ swallowNextCharacter = true ;
273
275
return true ;
274
276
} else if (isElementFocused && ClientProxy .FOCUS_LP_RENAME .isActiveAndMatches (inputCode ) && hasLabeller ()) {
275
277
// Open labeller gui
276
278
operatorInfoPattern .onButtonEditClick ();
279
+ swallowNextCharacter = true ;
277
280
return true ;
278
281
} else if (GLFW .GLFW_KEY_LEFT == keyCode && (!isElementFocused && isSearchFieldFocussed ())) {
279
282
// Unfocus search field
@@ -311,6 +314,11 @@ protected boolean handleKeyCode(int keyCode, int scanCode) {
311
314
312
315
@ Override
313
316
public boolean charTyped (char keyCode , int scanCode ) {
317
+ if (swallowNextCharacter ) {
318
+ swallowNextCharacter = false ;
319
+ return true ;
320
+ }
321
+
314
322
return subGuiHolder .charTyped (keyCode , scanCode ) || handleKeyCode (keyCode , scanCode ) || super .charTyped (keyCode , scanCode );
315
323
}
316
324
0 commit comments