diff options
-rw-r--r-- | src/jake2/sys/LWJGLKBD.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/jake2/sys/LWJGLKBD.java b/src/jake2/sys/LWJGLKBD.java index 3693697..ee5117e 100644 --- a/src/jake2/sys/LWJGLKBD.java +++ b/src/jake2/sys/LWJGLKBD.java @@ -81,15 +81,22 @@ public class LWJGLKBD extends KBD { my=0; } - while (Mouse.next()) - { - int button=Mouse.getEventButton(); - if (button >= 0) - { + while (Mouse.next()) { + int button = Mouse.getEventButton(); + if (button >= 0) { if (button == 1 && mouseHasTwoButtons) { button = 2; // A three button mouse numbering scheme... } Do_Key_Event(Key.K_MOUSE1 + button, Mouse.getEventButtonState()); + } else { + button = Mouse.getEventDWheel(); + if (button > 0) { + Do_Key_Event(Key.K_MWHEELUP, true); + Do_Key_Event(Key.K_MWHEELUP, false); + } else if (button < 0) { + Do_Key_Event(Key.K_MWHEELDOWN, true); + Do_Key_Event(Key.K_MWHEELDOWN, false); + } } } } |