diff options
Diffstat (limited to 'src/main/kotlin/com/dulkirfabric/features')
-rw-r--r-- | src/main/kotlin/com/dulkirfabric/features/KeyShortCutImpl.kt | 21 | ||||
-rw-r--r-- | src/main/kotlin/com/dulkirfabric/features/NoReverseCam.kt | 4 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/main/kotlin/com/dulkirfabric/features/KeyShortCutImpl.kt b/src/main/kotlin/com/dulkirfabric/features/KeyShortCutImpl.kt new file mode 100644 index 0000000..c94c258 --- /dev/null +++ b/src/main/kotlin/com/dulkirfabric/features/KeyShortCutImpl.kt @@ -0,0 +1,21 @@ +package com.dulkirfabric.features + +import com.dulkirfabric.config.DulkirConfig +import com.dulkirfabric.events.WorldKeyPressEvent +import com.dulkirfabric.util.TextUtils +import meteordevelopment.orbit.EventHandler + +object KeyShortCutImpl { + @EventHandler + fun onKeyPress(event: WorldKeyPressEvent) { + DulkirConfig.configOptions.macrosList.forEach { + if (it.keyBinding.code == event.key) { + // This conditional allows for these shortcuts to work for commands or normal messages + if (it.command.startsWith("/")) + TextUtils.sendCommand(it.command.substring(1)) + else + TextUtils.sendMessage(it.command) + } + } + } +}
\ No newline at end of file diff --git a/src/main/kotlin/com/dulkirfabric/features/NoReverseCam.kt b/src/main/kotlin/com/dulkirfabric/features/NoReverseCam.kt new file mode 100644 index 0000000..b8cb36d --- /dev/null +++ b/src/main/kotlin/com/dulkirfabric/features/NoReverseCam.kt @@ -0,0 +1,4 @@ +package com.dulkirfabric.features + +class NoReverseCam { +}
\ No newline at end of file |