This repository has been archived by the owner on Dec 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c74530c
commit 35cc3b0
Showing
4 changed files
with
38 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/io/wispforest/gadget/client/gui/TabTextBoxComponent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package io.wispforest.gadget.client.gui; | ||
|
||
import io.wispforest.owo.ui.component.TextBoxComponent; | ||
import io.wispforest.owo.ui.core.Sizing; | ||
import org.lwjgl.glfw.GLFW; | ||
|
||
public class TabTextBoxComponent extends TextBoxComponent { | ||
public TabTextBoxComponent(Sizing horizontalSizing) { | ||
super(horizontalSizing); | ||
} | ||
|
||
@Override | ||
public boolean keyPressed(int keyCode, int scanCode, int modifiers) { | ||
if (keyCode == GLFW.GLFW_KEY_TAB) { | ||
// Pass the event to the root component. | ||
root().onKeyPress(keyCode, scanCode, modifiers); | ||
|
||
return true; | ||
} | ||
|
||
return super.keyPressed(keyCode, scanCode, modifiers); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters