mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-09 16:45:46 -07:00
Add EscClose plugin
This commit is contained in:
parent
ca16d55a2e
commit
af1e323524
1 changed files with 23 additions and 0 deletions
23
plugin-playground/src/main/kotlin/EscClose/plugin.kt
Normal file
23
plugin-playground/src/main/kotlin/EscClose/plugin.kt
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
package EscClose
|
||||||
|
|
||||||
|
import plugin.Plugin
|
||||||
|
import plugin.annotations.PluginMeta
|
||||||
|
import plugin.api.API
|
||||||
|
import java.awt.event.KeyAdapter
|
||||||
|
import java.awt.event.KeyEvent
|
||||||
|
|
||||||
|
@PluginMeta (
|
||||||
|
author = "Chisato",
|
||||||
|
description = "Allows you to use ESC in order to (safety) close the open interface/dialogue.",
|
||||||
|
version = 1.0
|
||||||
|
)
|
||||||
|
class plugin : Plugin() {
|
||||||
|
override fun Init() {
|
||||||
|
API.AddKeyboardListener(object : KeyAdapter() {
|
||||||
|
override fun keyPressed(e: KeyEvent) {
|
||||||
|
if (e.keyCode == KeyEvent.VK_ESCAPE)
|
||||||
|
API.DispatchCommand("::xface")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue