Skip to content

Commit

Permalink
fix new ae2 Version
Browse files Browse the repository at this point in the history
  • Loading branch information
Mari023 committed May 14, 2021
1 parent 89a9f18 commit 8d9fdfd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import appeng.util.Platform;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.util.InputUtil;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -381,7 +382,7 @@ private IAEItemStack findVisualStack(final IAEItemStack l) {

@Override
public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_) {
if(!checkHotbarKeys(keyCode, scanCode)) {
if(!checkHotbarKeys(InputUtil.fromKeyCode(keyCode, scanCode))) {
if(keyCode == GLFW.GLFW_KEY_ENTER || keyCode == GLFW.GLFW_KEY_KP_ENTER) {
start();
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/de/mari_023/fabric/ae2wtlib/wit/WITScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@ public boolean keyPressed(int keyCode, int scanCode, int p_keyPressed_3_) {
InputUtil.Key input = InputUtil.fromKeyCode(keyCode, scanCode);
if(keyCode != GLFW.GLFW_KEY_ESCAPE) {
if(AppEng.instance().isActionKey(ActionKey.TOGGLE_FOCUS, input)) {
searchField.setFocused(!searchField.isFocused());
searchField.setTextFieldFocused(!searchField.isFocused());
return true;
}

// Forward keypresses to the search field
if(searchField.isFocused()) {
if(keyCode == GLFW.GLFW_KEY_ENTER) {
searchField.setFocused(false);
searchField.setTextFieldFocused(false);
return true;
}

Expand Down

0 comments on commit 8d9fdfd

Please sign in to comment.