diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-19 09:50:51 +0200 |
|---|---|---|
| committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-19 09:50:51 +0200 |
| commit | 3c9a36985344f748628c763c1898452727a8d4cc (patch) | |
| tree | c771709386134a3ca2bc4be2d1934211a0efbfcd /src/main/java/at/hannibal2/skyhanni/test | |
| parent | 454c1e59167851b40b9d7a6fccd75d7bedcf194c (diff) | |
| download | skyhanni-3c9a36985344f748628c763c1898452727a8d4cc.tar.gz skyhanni-3c9a36985344f748628c763c1898452727a8d4cc.tar.bz2 skyhanni-3c9a36985344f748628c763c1898452727a8d4cc.zip | |
Replacing Keyboard.isKeyDown and KeybindHelper.isKeyDown with OSUtils.isKeyHeld
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt | 5 | ||||
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/TestShowSlotNumber.kt | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt b/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt index e3df5c54c..7ae608d51 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt @@ -9,7 +9,6 @@ import net.minecraft.item.ItemStack import net.minecraft.nbt.NBTTagCompound import net.minecraftforge.client.event.GuiScreenEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import org.lwjgl.input.Keyboard import java.io.InputStreamReader import java.io.Reader @@ -41,8 +40,8 @@ object TestExportTools { } @SubscribeEvent - fun onKeybind(event: GuiScreenEvent.KeyboardInputEvent) { - if (!Keyboard.isKeyDown(SkyHanniMod.feature.dev.copyNBTDataCompressed)) return + fun onKeybind(event: GuiScreenEvent.KeyboardInputEvent.Post) { + if (!OSUtils.isKeyHeld(SkyHanniMod.feature.dev.copyNBTDataCompressed)) return val gui = event.gui as? GuiContainer ?: return val focussedSlot = gui.slotUnderMouse ?: return val stack = focussedSlot.stack ?: return diff --git a/src/main/java/at/hannibal2/skyhanni/test/TestShowSlotNumber.kt b/src/main/java/at/hannibal2/skyhanni/test/TestShowSlotNumber.kt index be202e20d..115cef414 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/TestShowSlotNumber.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/TestShowSlotNumber.kt @@ -2,14 +2,14 @@ package at.hannibal2.skyhanni.test import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.RenderInventoryItemTipEvent +import at.hannibal2.skyhanni.utils.OSUtils import net.minecraftforge.fml.common.eventhandler.SubscribeEvent -import org.lwjgl.input.Keyboard class TestShowSlotNumber { @SubscribeEvent fun onRenderItemTip(event: RenderInventoryItemTipEvent) { - if (Keyboard.isKeyDown(SkyHanniMod.feature.dev.showSlotNumberKey)) { + if (OSUtils.isKeyHeld(SkyHanniMod.feature.dev.showSlotNumberKey)) { val slotIndex = event.slot.slotIndex event.stackTip = "$slotIndex" } |
