public void keyReleased(KeyEvent e) {

    // Application.debug(e+"");

    /* test code to generate unicode strings for Virtual Keyboard
    String text = getText();
    String outStr = "";
    for (int i = 0 ; i < text.length() ; i++) {
    	int ch = text.charAt(i);
    	if (ch < 128) outStr += text.charAt(i);
    	else {
    		String unicode = Integer.toHexString(ch);
    		if (unicode.length() < 4) unicode = "\\u0"+unicode;
    		else unicode = "\\u"+unicode;
    		outStr += unicode;
    	}
    }
    Application.debug(outStr);
    //*/

    // ctrl pressed on Mac
    // or alt on Windows
    boolean modifierKeyPressed = Application.MAC_OS ? e.isControlDown() : e.isAltDown();

    // we don't want to act when AltGr is down
    // as it is used eg for entering {[}] is some locales
    // NB e.isAltGraphDown() doesn't work
    if (e.isAltDown() && e.isControlDown()) modifierKeyPressed = false;

    char charPressed = e.getKeyChar();

    if ((!isLetterOrDigit(charPressed) && !modifierKeyPressed)
        || (ctrlC && Application.MAC_OS) // don't want selection cleared
    ) return;

    clearSelection();

    // handle alt-p etc
    super.keyReleased(e);

    mergeKoreanDoubles();

    if (getAutoComplete()) {
      updateCurrentWord(false);
      startAutoCompletion();
    }

    /*
    if (charCodePressed == KeyEvent.VK_BACK_SPACE &&
      isTextSelected && input.length() > 0) {
        setText(input.substring(0, input.length()));
    }*/
  }