Commit 33dd6614 authored by Oleg Korshul's avatar Oleg Korshul

linux chrome input

parent 3b047fcf
......@@ -27,6 +27,8 @@
this.TextInputAfterComposition = false;
this.IsLockTargetMode = false;
this.IsUseFirstTextInputAfterComposition = false;
}
CTextInput.prototype =
......@@ -74,6 +76,7 @@
this.HtmlArea["onkeyup"] = function(e) { return oThis.onKeyUp(e); };
this.HtmlArea.addEventListener("input", function(e) { return oThis.onInput(e); }, false);
this.HtmlArea.addEventListener("textInput", function(e) { return oThis.onTextInput(e); }, false);
this.HtmlArea.addEventListener("compositionstart", function(e) { return oThis.onCompositionStart(e); }, false);
this.HtmlArea.addEventListener("compositionupdate", function(e) { return oThis.onCompositionUpdate(e); }, false);
......@@ -146,6 +149,15 @@
this.clear();
},
onTextInput : function(e)
{
if (this.IsUseFirstTextInputAfterComposition)
{
this.onCompositionEnd(e);
this.IsUseFirstTextInputAfterComposition = false;
}
},
onKeyDown : function(e)
{
// некоторые рукописные вводы не присылают keyUp
......@@ -270,8 +282,18 @@
onCompositionEnd : function(e)
{
// chrome, linux: всегда приходит пустая дата
if (e.data !== undefined && (e.data !== "" || (this.compositionValue.length == 0)))
if (!this.IsUseFirstTextInputAfterComposition)
{
if (e.data === undefined || (e.data == "" && (this.compositionValue.length != 0)))
{
this.IsUseFirstTextInputAfterComposition = true;
return;
}
}
else
{
this.onCompositionUpdate(e, false);
}
this.Listener.Set_CursorPosInCompositeText(1000); // max
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment