From dc8462dd55dddd3806e520234a87c7e01507feae Mon Sep 17 00:00:00 2001 From: ipkpjersi Date: Wed, 27 Dec 2023 21:30:53 -0500 Subject: [PATCH] Added take screenshot plugin --- .../src/main/kotlin/TakeScreenshot/plugin.kt | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 plugin-playground/src/main/kotlin/TakeScreenshot/plugin.kt diff --git a/plugin-playground/src/main/kotlin/TakeScreenshot/plugin.kt b/plugin-playground/src/main/kotlin/TakeScreenshot/plugin.kt new file mode 100644 index 0000000..d250c18 --- /dev/null +++ b/plugin-playground/src/main/kotlin/TakeScreenshot/plugin.kt @@ -0,0 +1,24 @@ +package TakeScreenshot + +import plugin.Plugin +import plugin.annotations.PluginMeta +import plugin.api.API +import java.awt.event.KeyAdapter +import java.awt.event.KeyEvent + +@PluginMeta ( + author = "ipkpjersi", + description = "Allows you to use CRTL + PRINTSCREEN to take a screenshot.", + version = 1.0 +) +class plugin : Plugin() { + override fun Init() { + API.AddKeyboardListener(object : KeyAdapter() { + override fun keyPressed(e: KeyEvent) { + if (e.keyCode == KeyEvent.VK_PRINTSCREEN && e.isControlDown) { + API.Screenshot() + } + } + }) + } +} \ No newline at end of file