tmp += filterInputMode(lastButton.getChars())[lastButtonCharIndex];
tmp += buttonChars[lastButtonCharIndex];
	public void keyPressed(int keyCode)	{		String tmp;        if (commonKeyPressed(keyCode)) {      return;    }		if (text.length() < maxSize) {      for (Enumeration e = ((AppletDevice) DeviceFactory.getDevice()).getButtons().elements(); e.hasMoreElements(); ) {        AppletButton button = (AppletButton) e.nextElement();        if (keyCode == button.getKey()) {          synchronized (this) {						lastButtonCharIndex++;            char[] buttonChars = filterConstraints(filterInputMode(button.getChars()));            if (buttonChars.length > 0) {              if (lastButtonCharIndex == buttonChars.length) {  							if (buttonChars.length == 1) {  								if (lastButton != null) {  									caret++;  								}  								lastButton = null;  							} else {  								lastButtonCharIndex = 0;  							}  						}  						if (lastButton != button) {  							if (lastButton != null) {  								caret++;  							}  							tmp = "";  							if (caret > 0) {  								tmp += text.substring(0, caret);  							}  							tmp += buttonChars[0];  							if (caret < text.length()) {  								tmp += text.substring(caret);  							}  							text = tmp;     						lastButton = button;  							lastButtonCharIndex = 0;  						} else {  							tmp = "";  							if (caret > 0) {  								tmp += text.substring(0, caret);  							}  							tmp += filterInputMode(lastButton.getChars())[lastButtonCharIndex];  							if (caret < text.length() - 1) {  								tmp += text.substring(caret + 1);  							}  							text = tmp;     						lastButton = button;  						}            } else {  						lastButton = null;              lastButtonCharIndex = -1;            }						resetKey = false;						notify();          }					InputMethodEvent event = new InputMethodEvent(InputMethodEvent.INPUT_METHOD_TEXT_CHANGED, caret, text);					inputMethodListener.inputMethodTextChanged(event);					break;				}			}		}	}