System.setIn(kis);
AccessController.doPrivileged(new PrivilegedAction() { public Object run() { System.setIn(kis); return null; } });
    protected synchronized void startDevice() throws DriverException {        this.channel = getChannel();        this.kbInterpreter = createKeyboardInterpreter();        final Device dev = getDevice();        final String id = dev.getId();        this.daemon = new KeyboardDaemon(id + "-daemon");        daemon.start();        this.eventQueueThread = new QueueProcessorThread<KeyboardEvent>(id + "-dispatcher",                eventQueue, new KeyboardEventDispatcher());        eventQueueThread.start();        dev.registerAPI(KeyboardAPI.class, this);        dev.registerAPI(SystemTriggerAPI.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);        }    }