aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/sys/LWJGLKBD.java
diff options
context:
space:
mode:
authorCarsten Weisse <[email protected]>2004-12-16 21:25:07 +0000
committerCarsten Weisse <[email protected]>2004-12-16 21:25:07 +0000
commit98bb4c0e7d65d7d5e8bb4264c6334fbf8bf4bf5a (patch)
tree07823b5f3ce5d0e9535ebac3e87512d658e42d1c /src/jake2/sys/LWJGLKBD.java
parentb106585d8408b9776c0654ae21f0990ea66c8b3d (diff)
fixes a right mouse button bug. (dsanders)
Diffstat (limited to 'src/jake2/sys/LWJGLKBD.java')
-rw-r--r--src/jake2/sys/LWJGLKBD.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/jake2/sys/LWJGLKBD.java b/src/jake2/sys/LWJGLKBD.java
index f6864e2..6b09c35 100644
--- a/src/jake2/sys/LWJGLKBD.java
+++ b/src/jake2/sys/LWJGLKBD.java
@@ -18,6 +18,8 @@ public class LWJGLKBD extends KBD {
private char[] lwjglKeycodeMap = null;
+ private boolean mouseHasTwoButtons = false;
+
public void Init()
{
try
@@ -34,6 +36,8 @@ public class LWJGLKBD extends KBD {
if (lwjglKeycodeMap == null) lwjglKeycodeMap = new char[256];
+ mouseHasTwoButtons = (Mouse.getButtonCount() == 2);
+
} catch (Exception e) {;}
}
@@ -86,8 +90,11 @@ public class LWJGLKBD extends KBD {
while (Mouse.next())
{
int button=Mouse.getEventButton();
- if (button>=0)
+ if (button >= 0)
{
+ if (button == 1 && mouseHasTwoButtons) {
+ button = 2; // A three button mouse numbering scheme...
+ }
Do_Key_Event(Key.K_MOUSE1 + button, Mouse.getEventButtonState());
}
}