if (!extendedMode) vk = keys.getKey(scancode).getLowerVirtuelKey();
if (!extendedMode){ if((flags & InputEvent.ALT_GRAPH_DOWN_MASK) != 0){ vk = keys.getKey(scancode).getAltGrVirtuelKey(); }else if((flags & InputEvent.SHIFT_DOWN_MASK) != 0){ vk = keys.getKey(scancode).getUpperVirtuelKey(); }else{ vk = keys.getKey(scancode).getLowerVirtuelKey(); } }
  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;    int vk = deriveKeyCode(scancode, extendedMode);    // debug output to find new keycodes//    System.out.println("[" + (extendedMode ? "E" : "N") + scancode + "," + vk + "] " /*+ KeyEvent.getKeyText(vk)*/);    if (!extendedMode)      vk = keys.getKey(scancode).getLowerVirtuelKey();    adjustFlags(vk, released);    // debug output to find new keycodes//    System.out.println("[" + (extendedMode ? "E" : "N") + scancode + "," + vk + "] " /*+ KeyEvent.getKeyText(vk)*/);    try    {      final char ch;      ch = interpretExtendedScanCode(scancode, vk, released, extendedMode);      return new KeyboardEvent(released ? KeyEvent.KEY_RELEASED : KeyEvent.KEY_PRESSED, time, flags, vk, ch);    }    catch (UnsupportedKeyException e)    {      final char ch;      if ((flags & InputEvent.SHIFT_DOWN_MASK) != 0)      {        ch = keys.getKey(scancode).getUpperChar();        if (!extendedMode)          vk = keys.getKey(scancode).getUpperVirtuelKey();      }      else if ((flags & InputEvent.ALT_GRAPH_DOWN_MASK) != 0)      {        ch = keys.getKey(scancode).getAltGrChar();        if (!extendedMode)          vk = keys.getKey(scancode).getAltGrVirtuelKey();      }      else      {        ch = keys.getKey(scancode).getLowerChar();      }      return new KeyboardEvent(released ? KeyEvent.KEY_RELEASED : KeyEvent.KEY_PRESSED, time, flags, vk, ch);    }    catch (DeadKeyException e)    {      return null;    }  }