mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-09 16:45:46 -07:00
Merge pull request #23 from Violet-Vibes/esc-to-close-interface-plugin
Add EscClose plugin
This commit is contained in:
commit
ed4cae15e7
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