Skip to content

Instantly share code, notes, and snippets.

@rao123dk
Created May 3, 2018 12:08
Show Gist options
  • Save rao123dk/3dac7a6738e453854ee96cf67fdaa3e0 to your computer and use it in GitHub Desktop.
Save rao123dk/3dac7a6738e453854ee96cf67fdaa3e0 to your computer and use it in GitHub Desktop.
Detect user input data when user type with Input method editor(IME).
//The compositionstart, compositionupdate and compositionend events might be helpful. They help you detect when IME input is being used.
EVENTS FIRE
When IME is visible :-
--> compositionstart, compositionupdate, compositionend, input
When IME closed :-
--> keydown, input
$('#id').on('compositionupdate', function(e) {
console.log(e.data);
});
$('#id').on('compositionstart', function(e) {
console.log(e.data);
});
$('#id').on('compositionend', function(e) {
console.log(e.data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment