From: Carsten W. <ca...@us...> - 2004-12-16 21:25:16
|
Update of /cvsroot/jake2/jake2/src/jake2/sys In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11357/src/jake2/sys Modified Files: LWJGLKBD.java Log Message: fixes a right mouse button bug. (dsanders) Index: LWJGLKBD.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sys/LWJGLKBD.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LWJGLKBD.java 16 Dec 2004 00:00:01 -0000 1.4 --- LWJGLKBD.java 16 Dec 2004 21:25:07 -0000 1.5 *************** *** 19,22 **** --- 19,24 ---- private char[] lwjglKeycodeMap = null; + private boolean mouseHasTwoButtons = false; + public void Init() { *************** *** 35,38 **** --- 37,42 ---- if (lwjglKeycodeMap == null) lwjglKeycodeMap = new char[256]; + mouseHasTwoButtons = (Mouse.getButtonCount() == 2); + } catch (Exception e) {;} } *************** *** 87,92 **** { int button=Mouse.getEventButton(); ! if (button>=0) { Do_Key_Event(Key.K_MOUSE1 + button, Mouse.getEventButtonState()); } --- 91,99 ---- { 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()); } |