jquery.terminal
jquery.terminal copied to clipboard
Set terminal readonly with keyboard present in Virtual Keyboard demo on Mobile
Keyboard is very cool 3rd party lib. If I use together with terminal on Android smartphone when I press a key default input keyboard pops up. Therefore keyboard is not really usable for inputting. How can I disable input from keyboard/Android input keyboard and only accept input via keyboard event? I tried
if (Modernizr.touch) {
$('#term').attr('readonly', 'readonly');
}
but it does not make what I want.
I think that freeze()
method should do just that but it seems that not all keys work if you freeze because terminal is disabled. Also on my Android phone when you click on keyboard key, terminal unfreezes.
Keyboard was created just to make it work better on mobile but now native keyboard works just fine on a phone, It was not a good example, but still I'll try to fix the issue.
It seems this is works you only need to use term.freeze(true);
or $('#term').terminal().freeze(true)
I'll add option that calling freeze();
will be the same as freeze(true);
My mistake it don't work, it freezes terminal and click don't work but invoking key event enable terminal.
Found the issue with the jQuery keyboard the problem is that the plugin focus his textarea on click. To fix this you just need to add this css:
.ui-keyboard-input {
display: none;
}
plus adding term.freeze(true);
to disable enabling terminal on click/touch. One issue is that backspace don't work. Will need to add a way to enable passing keyboard events when terminal is disabled. So probably will add readonly
option or method. this readonly
feature probably will need cursor enabled or disabled depending on option.
I'm closing this now, I've updated the jquery keyboard plugin (not minified version from Mottie/Keyboard) and it works fine, it don't open keyboard when you click on keys and you also have blinking cursor. Note to self always use latest version, that plugin was not updated for ages.
The keyboard is not centered but this is probably because of missing extension.
Hi, I little bit do not understand how will it work. You have updated (Mottie/Keyboard](https://github.com/Mottie/Keyboard) project?? I have long time ago didn't worked with jquery terminal.. I lost little context Could you write some simple example for this issue?
No I've didn't updated the project, I've updated the version I was using in a demo and it work with latest one.
Does it work for testing mobile https://terminal.jcubic.pl/virtualKeyboard.html ?
If I open it from my Androud phone the enter key does not work (backspace but you know) and if I click on the black area my Android keyboard pops up.
Native keyboard pops because terminal is enabled. You need to freeze it (call freeze(true)
- will need to set true as default, freeze() don't work)
Backspace and enter are still a problem, will need to update. Only tested if press key on VKeyboard don't trigger opening the native keyboard, since that was major issue.
marking this as low because that demo was created when there where issues with native keyboard that work with no problems right now.
thanks, it isn't high prio.
I am using freeze following way, looks does not work: scripts/css I am using from https://terminal.jcubic.pl/virtualKeyboard.html local css: .ui-keyboard-input { display: none; }
you need to call freeze on terminal object:
term.freeze(true);
or
$('#term').terminal().freeze(true);
and this do nothing:
$('#term').attr('readonly', 'readonly');