public KeyboardEvent interpretScancode(int scancode) {
public final KeyboardEvent interpretScancode(int scancode) { final boolean extendedMode = this.extendedMode;  if (scancode == XT_EXTENDED) { this.extendedMode = true; return null; } else { this.extendedMode = false; } final boolean released = ((scancode & XT_RELEASE) != 0); final long time = System.currentTimeMillis(); scancode &= 0x7f;
	public KeyboardEvent interpretScancode(int scancode) {				if (scancode == XT_EXTENDED) {			lastScancode = scancode;			return null;		}				boolean released = ((scancode & XT_RELEASE) != 0);		scancode &= 0x7f;		int vk = deriveKeyCode(scancode, (lastScancode == XT_EXTENDED));		// debug output to find new keycodes//		System.err.println("[" + (lastScancode == XT_EXTENDED ? "E" : "N") + scancode + "] " /*+ KeyEvent.getKeyText(vk)*/);		int mask;		switch (vk) {			case KeyEvent.VK_ALT :				mask = InputEvent.ALT_DOWN_MASK;				break;			case KeyEvent.VK_ALT_GRAPH :				mask = InputEvent.ALT_GRAPH_DOWN_MASK;				break;			case KeyEvent.VK_CONTROL :				mask = InputEvent.CTRL_DOWN_MASK;				break;			case KeyEvent.VK_SHIFT :				mask = InputEvent.SHIFT_DOWN_MASK;				break;			default :				mask = 0;		}				if (mask != 0) {			if (released) {				flags &= ~mask;			} else {				flags |= mask;			}		}		if (vk != 0) {			char ch;			try {				ch = interpretExtendedScanCode(scancode, vk, released);				long time = System.currentTimeMillis();				lastScancode = scancode;				return new KeyboardEvent(released ? KeyEvent.KEY_RELEASED : KeyEvent.KEY_PRESSED, time, flags, vk, ch);			} catch (UnsupportedKeyException e) {				if ((flags & InputEvent.SHIFT_DOWN_MASK) != 0) {					ch = ucharMap[scancode];				} else if((flags & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) {					ch = altGrCharMap[scancode];				} else {					ch = lcharMap[scancode];				}				long time = System.currentTimeMillis();				lastScancode = scancode;				return new KeyboardEvent(released ? KeyEvent.KEY_RELEASED : KeyEvent.KEY_PRESSED, time, flags, vk, ch);			}			catch (DeadKeyException e) {				return null;			}		} else {			lastScancode = scancode;			return null;		}	}