getDevice().unregisterAPI(KeyboardAPI.class); KeyboardDaemon daemon = this.daemon; if (System.in == kis) { System.setIn(null); } if (daemon != null) { daemon.interrupt(); } this.daemon = null;
final Device dev = getDevice(); dev.unregisterAPI(KeyboardAPI.class); dev.unregisterAPI(SystemTriggerAPI.class); KeyboardDaemon daemon = this.daemon; if (System.in == kis) { System.setIn(null); } if (eventQueueThread != null) { eventQueueThread.stopProcessor(); } this.eventQueueThread = null; if (daemon != null) { daemon.interrupt(); } this.daemon = null;
	protected synchronized void stopDevice() throws DriverException {		getDevice().unregisterAPI(KeyboardAPI.class);		KeyboardDaemon daemon = this.daemon;		if (System.in == kis) {			System.setIn(null);		}		if (daemon != null) {			daemon.interrupt();		}		this.daemon = null;		try {			channel.close();		} catch (IOException ex) {			System.err.println("Error closing Keyboard channel: " + ex.toString());		}	}