I have issue with Android in jQuery Terminal, I've almost fix it, it work on devices I've tested. Demo. But it seems that keypress event don't fire at all (It should echo keypress) on some devices.
On mobile I have code that keep focus on textarea (I resued clipboard) so virtual keyboard is open.
I have this code in keydown:
function keydown_event(e) {
...
if (enabled) {
...
} else {
// this get fired while typing
$.terminal.active().echo('keydown else');
prevent_keypress = false;
return;
}
// this will prevent for instance backspace to go back one page
prevent_keypress = true;
$.terminal.active().echo('keydown return false');
return false;
}
...
}
}
and in keypress:
var doc = $(document.documentElement || window);
doc.bind('keypress.cmd', function(e) {
var result;
if (e.ctrlKey && e.which === 99) { // CTRL+C
return;
}
// this line never get fired while typing
$.terminal.active().echo('keypress');
if (prevent_keypress) {
$.terminal.active().echo('prevent');
return;
}
if (!reverse_search && $.isFunction(options.keypress)) {
result = options.keypress(e);
}
if (result === undefined || result) {
...
self.insert(String.fromCharCode(e.which));
...
} else {
return result;
}
}).bind('keydown.cmd', keydown_event);
Anybody had same issue and know how to fix it, it's hard for me because it work on my devices.
UPDATE I've create simple test to isolate the problem and it seems that keypress is not fired at all.