illegal deadkey sequence fix

This commit is contained in:
daboe01
2015-06-09 19:26:41 +02:00
parent 6b923542e8
commit 09477384fe
+9 -2
View File
@@ -645,7 +645,11 @@ var kDelegateRespondsTo_textShouldBeginEditing
// interface to the _CPNativeInputManager
- (void)_activateNativeInputElement:(DOMElemet)aNativeField
{
[self insertText:aNativeField.innerHTML]; // FIXME: this hack to provide the visual space for the inputmanager should at least bypass the undomanager
var attributes=[[self typingAttributes] copy];
[attributes setObject:[CPColor colorWithRed:1 green:1 blue:1 alpha:0] forKey:CPForegroundColorAttributeName]; // make it invisible
var placeholderString = [[CPAttributedString alloc] initWithString:aNativeField.innerHTML attributes:attributes];
[self insertText:placeholderString]; // FIXME: this hack to provide the visual space for the inputmanager should at least bypass the undomanager
var caretRect = [_layoutManager boundingRectForGlyphRange:CPMakeRange(_selectionRange.location - 1, 1) inTextContainer:_textContainer];
caretRect.origin.x += 2; // two pixel offset to the LHS character
@@ -714,7 +718,10 @@ var kDelegateRespondsTo_textShouldBeginEditing
- (void)keyDown:(CPEvent)event
{
[[_window platformWindow] _propagateCurrentDOMEvent:YES]; // necessary for the _CPNativeInputManager to work
[self interpretKeyEvents:[event]];
if (![_CPNativeInputManager isNativeInputFieldActive] && [event charactersIgnoringModifiers].charCodeAt(0) != 229) // filter out 229 because this would be inserted in chrome on each deadkey
[self interpretKeyEvents:[event]];
[_caret setPermanentlyVisible:YES];
}