aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2
diff options
context:
space:
mode:
authorHolger Zickner <[email protected]>2004-12-15 19:43:19 +0000
committerHolger Zickner <[email protected]>2004-12-15 19:43:19 +0000
commita6286626c67b8aaa7d9ce951ec155885e441bcc8 (patch)
treea7d102ff80ede2158fe1e56a88cf705a6f538407 /src/jake2
parentcd934616ed3326187138beb36d689fd0b3aeb75a (diff)
reenable mousewheel support
Diffstat (limited to 'src/jake2')
-rw-r--r--src/jake2/sys/JOGLKBD.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/jake2/sys/JOGLKBD.java b/src/jake2/sys/JOGLKBD.java
index 18fccad..9e2dd1f 100644
--- a/src/jake2/sys/JOGLKBD.java
+++ b/src/jake2/sys/JOGLKBD.java
@@ -2,17 +2,8 @@ package jake2.sys;
import jake2.client.Key;
-import java.awt.AWTException;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Cursor;
-import java.awt.Insets;
-import java.awt.Point;
-import java.awt.Robot;
-import java.awt.event.ComponentEvent;
-import java.awt.event.InputEvent;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
+import java.awt.*;
+import java.awt.event.*;
import javax.swing.ImageIcon;
@@ -80,7 +71,18 @@ final public class JOGLKBD extends KBD
b=((MouseEvent)event.ev).getButton()-1;
Do_Key_Event(Key.K_MOUSE1 + b, false);
break;
-
+
+ case Jake2InputEvent.WheelMoved:
+ int dir = ((MouseWheelEvent)event.ev).getWheelRotation();
+ if (dir > 0) {
+ Do_Key_Event(Key.K_MWHEELDOWN, true);
+ Do_Key_Event(Key.K_MWHEELDOWN, false);
+ } else {
+ Do_Key_Event(Key.K_MWHEELUP, true);
+ Do_Key_Event(Key.K_MWHEELUP, false);
+ }
+ break;
+
case Jake2InputEvent.CreateNotify :
case Jake2InputEvent.ConfigureNotify :
Component c = ((ComponentEvent)event.ev).getComponent();