Multiple Mouse Buttons

Started by Juicebox360, November 18, 2010, 03:42:50

Previous topic - Next topic

Juicebox360

I've got a Mouse object working and I'm able to detect button presses, scrolling, etc. However, I am not sure how to go about checking if buttons other than the primary, secondary, or tertiary (scroll wheel) are pressed. For example, I have a five-button G9 Logitech mouse. I tried Mouse.isButtonDown( 3 ) then pressing the side buttons to no avail, and for some odd reason, LWJGL reports my mouse as having 16 buttons, although it is nowhere close to that staggering amount.

jediTofu

Try all of the button indexes from 0 to button count - 1, to see if the buttons are registered to another index:

for(int i = 0; i < Mouse.getButtonCount(); i++) {
  if(Mouse.isButtonDown(i)) {
    System.out.println("button pressed: " + i);
  }
}

Even if after trying that none of the non-standard buttons work, make sure your drivers are up-to-date for your mouse.  If that doesn't work, try using the Controllers class.
cool story, bro

Juicebox360

Doesn't seem like either of them work. The Controllers class doesn't seem to detect anything about my mouse (other than it being there and some other odds and ends) and the only real "driver" for the G9 is SetPoint. I went ahead and installed that but it still doesn't work. It's not a big deal, so I guess I'll look into it myself later or something. Thanks for your help, though.