public final synchronized long[] getRangeProperty(int object_identifier) throws IOException { checkReleased(); long[] range = new long[2]; int res = nGetRangeProperty(address, object_identifier, range); if (res != DI_OK) throw new IOException("Failed to get object range (" + res + ")"); return range; } private final static native int nGetRangeProperty(long address, int object_id, long[] range);
public final synchronized int getDeadzoneProperty(int object_identifier) throws IOException { checkReleased(); return nGetDeadzoneProperty(address, object_identifier); } private final static native int nGetDeadzoneProperty(long address, int object_id) throws IOException;
public final synchronized void setCooperativeLevel(int flags) throws IOException { checkReleased(); int res = nSetCooperativeLevel(address, window.getHwnd(), flags); if (res != DI_OK) throw new IOException("Failed to set cooperative level (" + Integer.toHexString(res) + ")"); } private final static native int nSetCooperativeLevel(long address, long hwnd_address, int flags);
public final synchronized void setBufferSize(int size) throws IOException { checkReleased(); unacquire(); int res = nSetBufferSize(address, size); if (res != DI_OK && res != DI_PROPNOEFFECT && res != DI_POLLEDDEVICE) throw new IOException("Failed to set buffer size (" + Integer.toHexString(res) + ")"); queue = new DataQueue(size, DIDeviceObjectData.class); queue.position(queue.limit()); acquire(); } private final static native int nSetBufferSize(long address, int size);
public final synchronized void pollAll() throws IOException { checkReleased(); poll(); getDeviceState(device_state); queue.compact(); getDeviceData(queue); queue.flip(); }