Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // incorrectly reports 16 buttons; only capable of reading first three.
- import org.lwjgl.*;
- import org.lwjgl.opengl.Display;
- import org.lwjgl.opengl.DisplayMode;
- import org.lwjgl.input.Mouse;
- public class MouseProperties
- {
- @SuppressWarnings("static-access")
- public static void main (String[] argv)
- {
- try
- {
- Display.setDisplayMode(new DisplayMode(200,200));
- Display.create();
- Mouse.create();
- if (Mouse.isCreated() && Display.isCreated())
- {
- System.out.println("\tNumber of buttons: " + Mouse.getButtonCount());
- System.out.println("Does mouse have wheel?");
- if (Mouse.hasWheel())
- System.out.println("\tMouse has wheel.");
- System.out.println("Determining which button is which: ");
- while (!Display.isCloseRequested())
- {
- Mouse.next();
- System.out.println("\t\t" + Mouse.getEventButton());
- Display.update();
- }
- Mouse.destroy();
- Display.destroy();
- }
- }
- catch (LWJGLException e )
- {
- e.printStackTrace();
- System.exit(0);
- }
- return;
- }
- }
Add Comment
Please, Sign In to add comment