File tree Expand file tree Collapse file tree 2 files changed +2
-17
lines changed
src/main/kotlin/com/lambda/event/events Expand file tree Collapse file tree 2 files changed +2
-17
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,6 @@ package com.lambda.event.events
2020import com.lambda.config.settings.complex.Bind
2121import com.lambda.event.Event
2222import com.lambda.util.KeyCode
23- import org.lwjgl.glfw.GLFW.GLFW_MOD_ALT
24- import org.lwjgl.glfw.GLFW.GLFW_MOD_CAPS_LOCK
25- import org.lwjgl.glfw.GLFW.GLFW_MOD_CONTROL
26- import org.lwjgl.glfw.GLFW.GLFW_MOD_NUM_LOCK
27- import org.lwjgl.glfw.GLFW.GLFW_MOD_SHIFT
28- import org.lwjgl.glfw.GLFW.GLFW_MOD_SUPER
2923import org.lwjgl.glfw.GLFW.GLFW_PRESS
3024import org.lwjgl.glfw.GLFW.GLFW_RELEASE
3125
@@ -55,7 +49,7 @@ sealed class KeyboardEvent {
5549 val isPressed = action >= GLFW_PRESS
5650 val isReleased = action == GLFW_RELEASE
5751
58- fun satisfies (bind : Bind ) = bind.key == keyCode && bind.modifiers == modifiers
52+ fun satisfies (bind : Bind ) = bind.key == keyCode && bind.modifiers and modifiers == bind. modifiers
5953 }
6054
6155 /* *
Original file line number Diff line number Diff line change @@ -20,14 +20,7 @@ package com.lambda.event.events
2020import com.lambda.config.settings.complex.Bind
2121import com.lambda.event.callback.Cancellable
2222import com.lambda.event.callback.ICancellable
23- import com.lambda.util.Mouse
2423import com.lambda.util.math.Vec2d
25- import org.lwjgl.glfw.GLFW.GLFW_MOD_ALT
26- import org.lwjgl.glfw.GLFW.GLFW_MOD_CAPS_LOCK
27- import org.lwjgl.glfw.GLFW.GLFW_MOD_CONTROL
28- import org.lwjgl.glfw.GLFW.GLFW_MOD_NUM_LOCK
29- import org.lwjgl.glfw.GLFW.GLFW_MOD_SHIFT
30- import org.lwjgl.glfw.GLFW.GLFW_MOD_SUPER
3124
3225sealed class MouseEvent {
3326 /* *
@@ -45,9 +38,7 @@ sealed class MouseEvent {
4538 val isReleased = action == 0
4639 val isPressed = action == 1
4740
48- fun satisfies (bind : Bind ) = bind.modifiers == modifiers && bind.mouse == button
49-
50- fun hasModifier (mod : Int ) = modifiers and mod == mod
41+ fun satisfies (bind : Bind ) = bind.modifiers and modifiers == bind.modifiers && bind.mouse == button
5142 }
5243
5344 /* *
You can’t perform that action at this time.
0 commit comments