Merge pull request #23 from Violet-Vibes/esc-to-close-interface-plugin

Add EscClose plugin
This commit is contained in:
Pazaz 2023-01-31 23:54:30 -05:00 committed by GitHub
commit ed4cae15e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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")
}
})
}
}