diff --git a/ime.js b/ime.js index 12c1c6c..9fb9a87 100644 --- a/ime.js +++ b/ime.js @@ -59,7 +59,7 @@ function imeDown(keyEvent, inputField) { imeReset(); break; case "Space": - //adds a ' + //adds a ', on second press . an actual space break; case "ArrowLeft": imeMove("left"); @@ -384,10 +384,20 @@ function imeInput(key) { break; case 2: //trailing if (hVowelsK.includes(key)) { - inputFull.push(getUnicodeVowel(key, "trailing")); - stateState += 1; + if (stateState == 1 && inputCurrent != "") { + inputFull.pop(); + inputFull.push(getUnicodeConsonant(inputCurrent, key)); + inputCurrent = ""; + //reset state??? + stateState = 0; + } else { + inputFull.push(getUnicodeVowel(key, "trailing")); + inputCurrent = ""; + stateState += 1; + } } else { inputFull.push(getUnicodeConsonant(key, "trailing")); + if (stateState == 0) inputCurrent = key; stateState += 1; } if (stateState == 2) {