mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-29 13:47:42 +00:00
illegal deadkey sequence fix
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user