Element targetElement = (Element) fmgr.getCurrentEventTarget();
if (targetElement == null) {
targetElement = context.getDocument().getDocumentElement();
}
DocumentEvent d = (DocumentEvent) targetElement.getOwnerDocument();
DOMKeyboardEvent keyEvt
= (DOMKeyboardEvent) d.createEvent("KeyboardEvent");
String modifiers
= DOMUtilities.getModifiersList(evt.getLockState(),
evt.getModifiers());
keyEvt.initKeyboardEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
eventType,
true,
true,
null,
mapKeyCodeToIdentifier(evt.getKeyCode()),