while ((channel != null) && channel.isOpen()) { try { buf.rewind(); if (channel.read(buf) != 1) { continue; } byte scancode = buf.get(0);  KeyboardEvent event = kbInterpreter.interpretScancode(scancode & 0xff); if (event != null) { dispatchEvent(event); } } catch (Throwable ex) { ex.printStackTrace(); } } }
while ((channel != null) && channel.isOpen()) { try { buf.rewind(); if (channel.read(buf) != 1) { continue; } byte scancode = buf.get(0);  KeyboardEvent event = kbInterpreter .interpretScancode(scancode & 0xff); if (event != null) { if ((event.getKeyCode() == KeyEvent.VK_PRINTSCREEN) && event.isKeyPressed() && event.isAltDown()) { dispatchSystemTriggerEvent(event); } if (!event.isConsumed()) { eventQueue.add(event); } } } catch (Throwable ex) { ex.printStackTrace(); } } }
		public void run() {			while ((channel != null) && channel.isOpen()) {				try {					buf.rewind();					if (channel.read(buf) != 1) {						continue;					}					byte scancode = buf.get(0);					//Syslog.debug("Interpreting " + scancode);					KeyboardEvent event = kbInterpreter.interpretScancode(scancode & 0xff);					if (event != null) {						dispatchEvent(event);					}				} catch (Throwable ex) {					ex.printStackTrace();				}			}		}