Skip to content

Commit

Permalink
Don't check for key presses in typing in chat
Browse files Browse the repository at this point in the history
  • Loading branch information
VixidDev committed Jun 28, 2024
1 parent d8eaefb commit 2266377
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/kotlin/dev/vixid/vsm/spotify/SpotifyDisplay.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import kotlinx.coroutines.launch
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents
import net.minecraft.client.MinecraftClient
import net.minecraft.client.gui.DrawContext
import net.minecraft.client.gui.screen.ChatScreen
import net.minecraft.client.util.InputUtil

object SpotifyDisplay : Overlay() {
Expand Down Expand Up @@ -48,6 +49,7 @@ object SpotifyDisplay : Overlay() {
}

private fun onKeyPress(key: Int, scancode: Int, action: Int, modifiers: Int) {
if (MinecraftClient.getInstance().currentScreen is ChatScreen) return
val translationKey = InputUtil.fromKeyCode(key, 0).translationKey
onPress(translationKey)
}
Expand Down

0 comments on commit 2266377

Please sign in to comment.