Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #17571 from RudyLu/keyboard/Bug983012_master
Browse files Browse the repository at this point in the history
Bug 983012 - [Sora][Message][Input method]The virtual keyboard is
r=timdream
  • Loading branch information
RudyLu committed Mar 26, 2014
2 parents 6a459bd + 9d44980 commit 77dab58
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions apps/keyboard/js/keyboard.js
Expand Up @@ -1596,6 +1596,7 @@ function switchToNextIME() {
}

function showIMEList() {
clearTouchedKeys();
var mgmt = navigator.mozInputMethod.mgmt;
mgmt.showAll();
}
Expand All @@ -1609,6 +1610,7 @@ function resetKeyboard() {
// separately after this function
isUpperCase = false;
isUpperCaseLocked = false;
clearTouchedKeys();
}

// This is a wrapper around inputContext.sendKey()
Expand Down Expand Up @@ -1944,6 +1946,27 @@ function isGreekSMS() {
return (currentInputMode === '-moz-sms' &&
keyboardName === 'el');
}

// Remove the event listeners on the touched keys and the highlighting.
// This is because sometimes DOM element is removed before
// touchend is fired.
function clearTouchedKeys() {
for (var id in touchedKeys) {
if (!touchedKeys[id]) {
continue;
}

var target = touchedKeys[id].target;
if (target) {
target.removeEventListener('touchmove', onTouchMove);
target.removeEventListener('touchend', onTouchEnd);
target.removeEventListener('touchcancel', onTouchEnd);
IMERender.unHighlightKey(target);
}
}

touchedKeys = {};
}
/*
* This is a helper to scroll the keyboard layout menu when the touch moves near
* the edge of the top or bottom of the menu
Expand Down

0 comments on commit 77dab58

Please sign in to comment.