aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHolger Zickner <[email protected]>2004-12-16 22:45:55 +0000
committerHolger Zickner <[email protected]>2004-12-16 22:45:55 +0000
commitb5892681cbae221b2fb6174770f8ce58409ed6eb (patch)
tree20fb616981bfa458c5ba5319c987dd0aa15986d9 /src
parentcac5258eab7d100c317ff68764bba963c52d5d77 (diff)
jwjgl mouse handling works fine without recentering
Diffstat (limited to 'src')
-rw-r--r--src/jake2/sys/IN.java11
-rw-r--r--src/jake2/sys/JOGLKBD.java1
-rw-r--r--src/jake2/sys/KBD.java4
-rw-r--r--src/jake2/sys/LWJGLKBD.java13
4 files changed, 4 insertions, 25 deletions
diff --git a/src/jake2/sys/IN.java b/src/jake2/sys/IN.java
index 4723d3e..70985d6 100644
--- a/src/jake2/sys/IN.java
+++ b/src/jake2/sys/IN.java
@@ -2,7 +2,7 @@
* IN.java
* Copyright (C) 2003
*
- * $Id: IN.java,v 1.6 2004-12-14 00:11:01 hzi Exp $
+ * $Id: IN.java,v 1.7 2004-12-16 22:45:55 hzi Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -34,12 +34,6 @@ import jake2.qcommon.Cvar;
import jake2.qcommon.xcommand_t;
import jake2.util.Math3D;
-import java.awt.Component;
-import java.awt.Cursor;
-import java.awt.Point;
-
-import javax.swing.ImageIcon;
-
/**
* IN
*/
@@ -80,10 +74,7 @@ public final class IN extends Globals {
}
private static void install_grabs() {
-
Globals.re.getKeyboardHandler().installGrabs();
- Globals.re.getKeyboardHandler().centerMouse();
-
ignorefirst = true;
}
diff --git a/src/jake2/sys/JOGLKBD.java b/src/jake2/sys/JOGLKBD.java
index 9e2dd1f..409d290 100644
--- a/src/jake2/sys/JOGLKBD.java
+++ b/src/jake2/sys/JOGLKBD.java
@@ -212,6 +212,7 @@ final public class JOGLKBD extends KBD
emptyCursor = c.getToolkit().createCustomCursor(emptyIcon.getImage(), new Point(0, 0), "emptyCursor");
}
c.setCursor(emptyCursor);
+ centerMouse();
}
public void uninstallGrabs()
diff --git a/src/jake2/sys/KBD.java b/src/jake2/sys/KBD.java
index 426778d..2ed7ac0 100644
--- a/src/jake2/sys/KBD.java
+++ b/src/jake2/sys/KBD.java
@@ -2,7 +2,7 @@
* KBD.java
* Copyright (C) 2004
*
- * $Id: KBD.java,v 1.6 2004-12-14 00:11:01 hzi Exp $
+ * $Id: KBD.java,v 1.7 2004-12-16 22:45:55 hzi Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -47,6 +47,6 @@ abstract public class KBD {
abstract public void installGrabs();
abstract public void uninstallGrabs();
- abstract public void centerMouse();
+ //abstract public void centerMouse();
}
diff --git a/src/jake2/sys/LWJGLKBD.java b/src/jake2/sys/LWJGLKBD.java
index 6b09c35..3693697 100644
--- a/src/jake2/sys/LWJGLKBD.java
+++ b/src/jake2/sys/LWJGLKBD.java
@@ -12,9 +12,6 @@ import org.lwjgl.opengl.Display;
* @author dsanders
*/
public class LWJGLKBD extends KBD {
-
- private int win_w2;
- private int win_h2;
private char[] lwjglKeycodeMap = null;
@@ -31,9 +28,6 @@ public class LWJGLKBD extends KBD {
if (!Keyboard.isTranslationEnabled()) Keyboard.enableTranslation();
if (!Mouse.isBuffered()) Mouse.enableBuffer();
- win_w2=Display.getDisplayMode().getWidth()/2;
- win_h2=Display.getDisplayMode().getHeight()/2;
-
if (lwjglKeycodeMap == null) lwjglKeycodeMap = new char[256];
mouseHasTwoButtons = (Mouse.getButtonCount() == 2);
@@ -187,13 +181,6 @@ public class LWJGLKBD extends KBD {
public void Do_Key_Event(int key, boolean down) {
Key.Event(key, down, Sys.Milliseconds());
}
-
- public void centerMouse()
- {
- Mouse.setPosition(win_x + win_w2,win_y + win_h2);
- //Mouse.setGrabbed(true);
- //Mouse.setTrackingEnabled(true);
- }
public void installGrabs()
{