diff options
| author | Linnea Gräf <nea@nea.moe> | 2025-06-17 20:59:45 +0200 |
|---|---|---|
| committer | Linnea Gräf <nea@nea.moe> | 2025-06-17 21:19:43 +0200 |
| commit | 4b9e966ca7e8a9291f307850f715820e122d69fd (patch) | |
| tree | 94b08c865c882f93ff9c0c6aa7a507d47bcc67bf /src/main/kotlin/events | |
| parent | 775933d516db10dbcc1cbbe405defa7b6e0c5a6a (diff) | |
| download | Firmament-4b9e966ca7e8a9291f307850f715820e122d69fd.tar.gz Firmament-4b9e966ca7e8a9291f307850f715820e122d69fd.tar.bz2 Firmament-4b9e966ca7e8a9291f307850f715820e122d69fd.zip | |
feat: Add macro wheels
Diffstat (limited to 'src/main/kotlin/events')
| -rw-r--r-- | src/main/kotlin/events/WorldKeyboardEvent.kt | 17 | ||||
| -rw-r--r-- | src/main/kotlin/events/WorldMouseMoveEvent.kt | 5 |
2 files changed, 13 insertions, 9 deletions
diff --git a/src/main/kotlin/events/WorldKeyboardEvent.kt b/src/main/kotlin/events/WorldKeyboardEvent.kt index e8566fd..1d6a758 100644 --- a/src/main/kotlin/events/WorldKeyboardEvent.kt +++ b/src/main/kotlin/events/WorldKeyboardEvent.kt @@ -1,18 +1,17 @@ - - package moe.nea.firmament.events import net.minecraft.client.option.KeyBinding import moe.nea.firmament.keybindings.IKeyBinding data class WorldKeyboardEvent(val keyCode: Int, val scanCode: Int, val modifiers: Int) : FirmamentEvent.Cancellable() { - companion object : FirmamentEventBus<WorldKeyboardEvent>() + companion object : FirmamentEventBus<WorldKeyboardEvent>() - fun matches(keyBinding: KeyBinding): Boolean { - return matches(IKeyBinding.minecraft(keyBinding)) - } + fun matches(keyBinding: KeyBinding): Boolean { + return matches(IKeyBinding.minecraft(keyBinding)) + } - fun matches(keyBinding: IKeyBinding): Boolean { - return keyBinding.matches(keyCode, scanCode, modifiers) - } + fun matches(keyBinding: IKeyBinding, atLeast: Boolean = false): Boolean { + return if (atLeast) keyBinding.matchesAtLeast(keyCode, scanCode, modifiers) else + keyBinding.matches(keyCode, scanCode, modifiers) + } } diff --git a/src/main/kotlin/events/WorldMouseMoveEvent.kt b/src/main/kotlin/events/WorldMouseMoveEvent.kt new file mode 100644 index 0000000..7a17ba4 --- /dev/null +++ b/src/main/kotlin/events/WorldMouseMoveEvent.kt @@ -0,0 +1,5 @@ +package moe.nea.firmament.events + +data class WorldMouseMoveEvent(val deltaX: Double, val deltaY: Double) : FirmamentEvent.Cancellable() { + companion object : FirmamentEventBus<WorldMouseMoveEvent>() +} |
