Skip to content

Tizen API: IME

zuzu_yun edited this page Jan 3, 2017 · 7 revisions

For converting IME of tizen to TOAST API, please refer to the followings.

  • Before

    var IME = document.getElementById('searchText'); // 'searchText' : id of input tag
    IME.focus();
    imeReady(); //imeShell ready callback function
    
    IME.addEventListener('keydown', function (e) {
        if(e.keyCode == 65376){
            // when you press the Done button in OSK
            EnterCallback();
            IME.blur();
          } else if (e.keyCode == 65385) {
            // when you press the Cancel button in OSK
            // or return key in remote control
            IME.blur();
        }
        e.stopPropagation();
    });
  • After

    imeEle = document.getElementById('searchText'); // 'searchText' : id of input tag
    
    imeEle.addEventListener('submit', function (e) {
        console.log('The DONE button of IME is pushed');
    });
    
    imeEle.addEventListener('cancel', function (e) {
        console.log('The CANCEL button of IME is pushed');
    });
    
    imeEle.addEventListener('blur', function (e) {
        console.log('The INPUT element loses focus');
    
        if(imeEle.getAttribute('data-ime-show') == 'false') {
            console.log('The IME is closed');
        }
    });
    imeEle.focus();

Check Point

  • If e.preventDefault method is called, the default action(Insert/delete text) of the input tag will not be triggered. So if you used e.preventDefault method on keydown handler, you should remove it.
Clone this wiki locally