diff options
author | Holger Zickner <[email protected]> | 2004-12-20 15:24:30 +0000 |
---|---|---|
committer | Holger Zickner <[email protected]> | 2004-12-20 15:24:30 +0000 |
commit | 0de669222b0b43f82b77c4e7c88aa2bfc9efc9da (patch) | |
tree | 3914a0b3f466172be3659bce3f0ac4b78014f972 /src/jake2 | |
parent | 2929e1720deafe2014a7af78d62fba2257619672 (diff) |
mousewheel support
Diffstat (limited to 'src/jake2')
-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); + } } } } |