Move focusGained to mixins
Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -240,14 +240,6 @@ public class Hooks
|
||||
keyManager.processKeyTyped(keyEvent);
|
||||
}
|
||||
|
||||
public static void focusGained(KeyFocusListener l, FocusEvent focusEvent)
|
||||
{
|
||||
FocusChanged focusChanged = new FocusChanged();
|
||||
focusChanged.setFocused(true);
|
||||
|
||||
eventBus.post(focusChanged);
|
||||
}
|
||||
|
||||
public static void focusLost(KeyFocusListener l, FocusEvent focusEvent)
|
||||
{
|
||||
FocusChanged focusChanged = new FocusChanged();
|
||||
|
||||
@@ -24,10 +24,14 @@
|
||||
*/
|
||||
package net.runelite.mixins;
|
||||
|
||||
import java.awt.event.FocusEvent;
|
||||
import net.runelite.api.events.FocusChanged;
|
||||
import net.runelite.api.mixins.Copy;
|
||||
import net.runelite.api.mixins.Inject;
|
||||
import net.runelite.api.mixins.MethodHook;
|
||||
import net.runelite.api.mixins.Mixin;
|
||||
import net.runelite.api.mixins.Replace;
|
||||
import static net.runelite.client.callback.Hooks.eventBus;
|
||||
import net.runelite.rs.api.RSGameEngine;
|
||||
|
||||
@Mixin(RSGameEngine.class)
|
||||
@@ -59,4 +63,13 @@ public abstract class RSGameEngineMixin implements RSGameEngine
|
||||
thread = Thread.currentThread();
|
||||
rs$run();
|
||||
}
|
||||
|
||||
@Inject
|
||||
@MethodHook("focusGained")
|
||||
public void onFocusGained(FocusEvent focusEvent)
|
||||
{
|
||||
final FocusChanged focusChanged = new FocusChanged();
|
||||
focusChanged.setFocused(true);
|
||||
eventBus.post(focusChanged);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user