From 1eb7483d3561dd80d3623c32d37e0ba7b2138ccd Mon Sep 17 00:00:00 2001 From: downthecrop Date: Thu, 24 Oct 2024 20:58:45 -0700 Subject: [PATCH] Regain focus on click --- plugin-playground/src/main/kotlin/KondoKit/plugin.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin-playground/src/main/kotlin/KondoKit/plugin.kt b/plugin-playground/src/main/kotlin/KondoKit/plugin.kt index bc550e3..a1b5137 100644 --- a/plugin-playground/src/main/kotlin/KondoKit/plugin.kt +++ b/plugin-playground/src/main/kotlin/KondoKit/plugin.kt @@ -41,13 +41,11 @@ import rt4.GlRenderer import rt4.InterfaceList import rt4.Player import rt4.SoftwareRaster -import rt4.client.js5Archive8 -import rt4.client.mainLoadState +import rt4.client.* import java.awt.* import java.awt.event.* import java.awt.image.VolatileImage import javax.swing.* -import javax.swing.plaf.nimbus.AbstractRegionPainter @Target(AnnotationTarget.FIELD) @@ -207,6 +205,7 @@ class plugin : Plugin() { }) isFocusable = true + requestFocusInWindow() } private fun validateGameImage() { @@ -280,6 +279,7 @@ class plugin : Plugin() { } private fun relayMouseEvent(e: MouseEvent) { + this.requestFocusInWindow() val adjustedX = (e.x - offsetX) / scaleX val adjustedY = (e.y - offsetY) / scaleY