public boolean isInitialized(){ return Mouse.isCreated(); }
@Override public void setInputListener(RawInputListener listener) { this.listener = listener; if (listener != null && Mouse.isCreated()) { sendFirstMouseEvent(); } }
private void pauseCanvas(){ if (Mouse.isCreated()){ if (Mouse.isGrabbed()){ Mouse.setGrabbed(false); mouseWasGrabbed = true; } mouseWasCreated = true; Mouse.destroy(); } if (Keyboard.isCreated()){ keyboardWasCreated = true; Keyboard.destroy(); } renderable.set(false); destroyContext(); }
/** * Send the input listener a special mouse-motion event with zero deltas in * order to initialize the listener's cursor position. */ private void sendFirstMouseEvent() { assert listener != null; assert Mouse.isCreated(); int x = Mouse.getX(); int y = Mouse.getY(); int xDelta = 0; int yDelta = 0; int wheelDelta = 0; MouseMotionEvent evt = new MouseMotionEvent(x, y, xDelta, yDelta, curWheel, wheelDelta); evt.setTime(Mouse.getEventNanoseconds()); listener.onMouseMotionEvent(evt); }
void updateMouse () { justTouched = false; if (Mouse.isCreated()) { int events = 0; while (Mouse.next()) {
void updateMouse () { justTouched = false; if (Mouse.isCreated()) { int events = 0; while (Mouse.next()) {
public boolean isInitialized(){ return Mouse.isCreated(); }
public void init() { if (!Mouse.isCreated()) { try { Mouse.create(); } catch (final Exception e) { throw new RuntimeException(e); } } }
private void init() { if (!_inited) { if (!Mouse.isCreated()) { try { Mouse.create(); } catch (final Exception e) { // this typically happens if the Display hasn't been initialized. throw new RuntimeException("Unable to initialise mouse manager", e); } } _inited = true; } }
public synchronized void pollDevice() throws IOException { if (!org.lwjgl.input.Mouse.isCreated()) return; org.lwjgl.input.Mouse.poll(); for (int i = 0; i < 3; i++) setButtonState(i); }
private void pauseCanvas(){ if (Mouse.isCreated()){ if (Mouse.isGrabbed()){ Mouse.setGrabbed(false); mouseWasGrabbed = true; } mouseWasCreated = true; Mouse.destroy(); } if (Keyboard.isCreated()){ keyboardWasCreated = true; Keyboard.destroy(); } renderable.set(false); destroyContext(); }
void updateMouse () { justTouched = false; if (Mouse.isCreated()) { int events = 0; while (Mouse.next()) {
protected synchronized boolean getNextDeviceEvent(Event event) throws IOException { if (!org.lwjgl.input.Mouse.isCreated()) return false; while (true) {