public LwjglInput () { Keyboard.enableRepeatEvents(false); Mouse.setClipMouseCoordinatesToWindow(false); }
@Override public boolean isCursorCatched () { return Mouse.isGrabbed(); }
public boolean isTouched () { boolean button = Mouse.isButtonDown(0) || Mouse.isButtonDown(1) || Mouse.isButtonDown(2); return button; }
public int getX () { return (int)(Mouse.getX() * Display.getPixelScaleFactor()); }
@Override public void setSystemCursor (SystemCursor systemCursor) { if (canvas != null && SharedLibraryLoader.isMac) { return; } try { Mouse.setNativeCursor(null); } catch (LWJGLException e) { throw new GdxRuntimeException("Couldn't set system cursor"); } }
@Override public void setCursorCatched (boolean catched) { Mouse.setGrabbed(catched); }
@Override public void setCursorPosition (int x, int y) { Mouse.setCursorPosition(x, Gdx.graphics.getHeight() - 1 - y); }
public boolean isTouched () { boolean button = Mouse.isButtonDown(0) || Mouse.isButtonDown(1) || Mouse.isButtonDown(2); return button; }
public LwjglInput () { Keyboard.enableRepeatEvents(false); Mouse.setClipMouseCoordinatesToWindow(false); }
@Override public void setCursor (com.badlogic.gdx.graphics.Cursor cursor) { if (canvas != null && SharedLibraryLoader.isMac) { return; } try { Mouse.setNativeCursor(((LwjglCursor)cursor).lwjglCursor); } catch (LWJGLException e) { throw new GdxRuntimeException("Could not set cursor image.", e); } }
@Override public void setCursorCatched (boolean catched) { Mouse.setGrabbed(catched); }
@Override public boolean isCursorCatched () { return Mouse.isGrabbed(); }
@Override public void setCursorPosition (int x, int y) { Mouse.setCursorPosition(x, Gdx.graphics.getHeight() - 1 - y); }
@Override public boolean isButtonPressed (int button) { return Mouse.isButtonDown(toLwjglButton(button)); }
@Override public void setCursor (com.badlogic.gdx.graphics.Cursor cursor) { if (canvas != null && SharedLibraryLoader.isMac) { return; } try { Mouse.setNativeCursor(((LwjglCursor)cursor).lwjglCursor); } catch (LWJGLException e) { throw new GdxRuntimeException("Could not set cursor image.", e); } }
@Override public boolean isButtonPressed (int button) { return Mouse.isButtonDown(toLwjglButton(button)); }
@Override public void setSystemCursor (SystemCursor systemCursor) { if (canvas != null && SharedLibraryLoader.isMac) { return; } try { Mouse.setNativeCursor(null); } catch (LWJGLException e) { throw new GdxRuntimeException("Couldn't set system cursor"); } }