if (page.getFocusedElement() != this) {
focus();
}
final int keyCode = KeyboardEvent.charToKeyCode(c);
final Event keyDown = new KeyboardEvent(this, Event.TYPE_KEY_DOWN, keyCode, shiftKey, ctrlKey, altKey);
final ScriptResult keyDownResult = fireEvent(keyDown);
final Event keyPress = new KeyboardEvent(this, Event.TYPE_KEY_PRESS, keyCode, shiftKey, ctrlKey, altKey);
final ScriptResult keyPressResult = fireEvent(keyPress);
if (!keyDown.isAborted(keyDownResult) && !keyPress.isAborted(keyPressResult)) {
doType(c, shiftKey, ctrlKey, altKey);
}
final boolean ie = page.getWebClient().getBrowserVersion().isIE();
if (!ie
&& (this instanceof HtmlTextInput
|| this instanceof HtmlTextArea
|| this instanceof HtmlPasswordInput)) {
final Event input = new KeyboardEvent(this, Event.TYPE_INPUT, keyCode, shiftKey, ctrlKey, altKey);
fireEvent(input);
}
final Event keyUp = new KeyboardEvent(this, Event.TYPE_KEY_UP, keyCode, shiftKey, ctrlKey, altKey);
fireEvent(keyUp);
final HtmlForm form = getEnclosingForm();
if (form != null && c == '\n' && isSubmittableByEnter()) {
if (!ie) {