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

Add text input support for Android. #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions jquery.console.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,25 @@
}, 0);
});


////////////////////////////////////////////////////////////////////////
// Handle Android text input.

typer.on('textInput', e => {
var data = e.originalEvent.data;
if (acceptInput) {
if ( typeof config.charInsertTrigger == 'undefined' ||
typeof config.charInsertTrigger == 'function'){
for(var i = 0; i < data.length; i++) {
if(!config.charInsertTrigger(data.charCodeAt(i))) {
return;
}
}

typer.consoleInsert(data);
}
}
});
////////////////////////////////////////////////////////////////////////
// Handle key hit before translation
// For picking up control characters like up/left/down/right
Expand Down