final Device dev = getDevice(); this.daemon = new KeyboardDaemon(dev.getId() + "-daemon"); daemon.start(); dev.registerAPI(KeyboardAPI.class, this);
final Device dev = getDevice(); final String id = dev.getId(); this.daemon = new KeyboardDaemon(id + "-daemon"); daemon.start(); this.eventQueueThread = new QueueProcessorThread(id + "-dispatcher", eventQueue, new KeyboardEventDispatcher()); eventQueueThread.start(); dev.registerAPI(KeyboardAPI.class, this); dev.registerAPI(SystemTriggerAPI.class, this);
	protected synchronized void startDevice() throws DriverException {		this.channel = getChannel();		this.kbInterpreter = createKeyboardInterpreter();		final Device dev = getDevice();		this.daemon = new KeyboardDaemon(dev.getId() + "-daemon");		daemon.start();		dev.registerAPI(KeyboardAPI.class, this);		// If no inputstream has been defined, create and set one.		if (System.in == null) {			if (channel == null) {				// even for keyboardless operation, we do need a System.in				kis = new InputStream() {					public int read() {						return -1;					}				};			} else {				kis = new KeyboardInputStream(this);			}			System.setIn(kis);		}	}