aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/sys/LWJGLKBD.java
diff options
context:
space:
mode:
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());
}
}