I am trying to write my own InputHandler and I have encountered a strange problem. Take a look at the following test code:
@Override
public void performAction(InputActionEvent evt) {
ArrayList<Integer> pressed = new ArrayList<Integer>();
for (int i = 0; i < MouseInput.get().getButtonCount(); i++) {
if (MouseInput.get().isButtonDown(i)) {
pressed.add(i);
}
}
System.out.println(pressed);
...
When I have pressed my left mouse button, the output is [ 0] (without the space)
When I have pressed my middle mouse button, the output is [2]
BUT when I have pressed my right mouse button, the output is []
- Why shouldn't it recognize it my right mouse button? (I tried trying with INPUT_AWT, but I didn't get any mouse events with it - don't know if I used it correctly, but that's another topic)
- Is it guaranteed that 0, 1(?) and 2 always stand for, respectively, left, right and middle button? If not, how can I find out which constants I should use?
Thank you :)