Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
71202663
Commit
71202663
authored
Feb 06, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
android backspace emulate
parent
9b2818bd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
common/text_input.js
common/text_input.js
+30
-0
No files found.
common/text_input.js
View file @
71202663
...
@@ -165,6 +165,8 @@
...
@@ -165,6 +165,8 @@
this
.
virtualKeyboardClickTimeout
=
-
1
;
this
.
virtualKeyboardClickTimeout
=
-
1
;
this
.
virtualKeyboardClickPrevent
=
false
;
this
.
virtualKeyboardClickPrevent
=
false
;
this
.
AndroidKeyboardDetectBackspace
=
false
;
}
}
CTextInput
.
prototype
=
CTextInput
.
prototype
=
...
@@ -256,6 +258,7 @@
...
@@ -256,6 +258,7 @@
};
};
this
.
HtmlArea
[
"
onkeypress
"
]
=
function
(
e
)
this
.
HtmlArea
[
"
onkeypress
"
]
=
function
(
e
)
{
{
oThis
.
AndroidKeyboardDetectBackspace
=
false
;
if
(
oThis
.
IsDisableKeyPress
==
true
)
if
(
oThis
.
IsDisableKeyPress
==
true
)
{
{
// macOS Sierra send keypress before copy event
// macOS Sierra send keypress before copy event
...
@@ -274,27 +277,33 @@
...
@@ -274,27 +277,33 @@
this
.
HtmlArea
.
addEventListener
(
"
input
"
,
function
(
e
)
this
.
HtmlArea
.
addEventListener
(
"
input
"
,
function
(
e
)
{
{
oThis
.
AndroidKeyboardDetectBackspace
=
false
;
return
oThis
.
onInput
(
e
);
return
oThis
.
onInput
(
e
);
},
false
);
},
false
);
this
.
HtmlArea
.
addEventListener
(
"
textInput
"
,
function
(
e
)
this
.
HtmlArea
.
addEventListener
(
"
textInput
"
,
function
(
e
)
{
{
oThis
.
AndroidKeyboardDetectBackspace
=
false
;
return
oThis
.
onTextInput
(
e
);
return
oThis
.
onTextInput
(
e
);
},
false
);
},
false
);
this
.
HtmlArea
.
addEventListener
(
"
text
"
,
function
(
e
)
this
.
HtmlArea
.
addEventListener
(
"
text
"
,
function
(
e
)
{
{
oThis
.
AndroidKeyboardDetectBackspace
=
false
;
return
oThis
.
onTextInput
(
e
);
return
oThis
.
onTextInput
(
e
);
},
false
);
},
false
);
this
.
HtmlArea
.
addEventListener
(
"
compositionstart
"
,
function
(
e
)
this
.
HtmlArea
.
addEventListener
(
"
compositionstart
"
,
function
(
e
)
{
{
oThis
.
AndroidKeyboardDetectBackspace
=
false
;
return
oThis
.
onCompositionStart
(
e
);
return
oThis
.
onCompositionStart
(
e
);
},
false
);
},
false
);
this
.
HtmlArea
.
addEventListener
(
"
compositionupdate
"
,
function
(
e
)
this
.
HtmlArea
.
addEventListener
(
"
compositionupdate
"
,
function
(
e
)
{
{
oThis
.
AndroidKeyboardDetectBackspace
=
false
;
return
oThis
.
onCompositionUpdate
(
e
);
return
oThis
.
onCompositionUpdate
(
e
);
},
false
);
},
false
);
this
.
HtmlArea
.
addEventListener
(
"
compositionend
"
,
function
(
e
)
this
.
HtmlArea
.
addEventListener
(
"
compositionend
"
,
function
(
e
)
{
{
oThis
.
AndroidKeyboardDetectBackspace
=
false
;
return
oThis
.
onCompositionEnd
(
e
);
return
oThis
.
onCompositionEnd
(
e
);
},
false
);
},
false
);
...
@@ -1001,6 +1010,12 @@
...
@@ -1001,6 +1010,12 @@
onKeyDown
:
function
(
e
)
onKeyDown
:
function
(
e
)
{
{
if
(
AscCommon
.
AscBrowser
.
isAndroid
)
{
if
(
e
.
keyCode
==
229
&&
e
.
charCode
==
0
&&
e
.
key
==
"
Unidentified
"
)
this
.
AndroidKeyboardDetectBackspace
=
true
;
}
this
.
isChromeKeysNoKeyPressPresent
=
false
;
this
.
isChromeKeysNoKeyPressPresent
=
false
;
if
(
this
.
isSystem
&&
this
.
isShow
)
if
(
this
.
isSystem
&&
this
.
isShow
)
{
{
...
@@ -1096,6 +1111,9 @@
...
@@ -1096,6 +1111,9 @@
onKeyUp
:
function
(
e
)
onKeyUp
:
function
(
e
)
{
{
this
.
isChromeKeysNoKeyPressPresent
=
false
;
this
.
isChromeKeysNoKeyPressPresent
=
false
;
var
oldAndroidKeyboardDetectBackspace
=
this
.
AndroidKeyboardDetectBackspace
;
this
.
AndroidKeyboardDetectBackspace
=
false
;
if
(
this
.
isSystem
&&
this
.
isShow
)
if
(
this
.
isSystem
&&
this
.
isShow
)
return
;
return
;
...
@@ -1114,7 +1132,19 @@
...
@@ -1114,7 +1132,19 @@
}
}
if
(
c_oCompositionState
.
end
==
this
.
compositionState
)
if
(
c_oCompositionState
.
end
==
this
.
compositionState
)
{
if
(
AscCommon
.
AscBrowser
.
isAndroid
&&
oldAndroidKeyboardDetectBackspace
)
{
if
(
e
.
keyCode
==
229
&&
e
.
charCode
==
0
&&
e
.
key
==
"
Unidentified
"
)
{
// backspace? по-другому определить не могу
this
.
emulateKeyDownApi
(
8
);
return
false
;
}
}
return
this
.
Api
.
onKeyUp
(
e
);
return
this
.
Api
.
onKeyUp
(
e
);
}
if
(
AscCommon
.
AscBrowser
.
isChrome
||
if
(
AscCommon
.
AscBrowser
.
isChrome
||
AscCommon
.
AscBrowser
.
isSafari
||
AscCommon
.
AscBrowser
.
isSafari
||
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment