Tizen API: IME - Samsung/cordova-plugin-toast GitHub Wiki
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 usede.preventDefault
method on keydown handler, you should remove it.