Mottie / Keyboard

Virtual Keyboard using jQuery ~
http://mottie.github.io/Keyboard/
Other
1.78k stars 723 forks source link

Will the keyboard play nicely with JQuery Mobile 1.4.5? #478

Open Michael-F-Ellis opened 8 years ago

Michael-F-Ellis commented 8 years ago

I need a nice virtual keyboard for running a web kiosk on a Raspberry Pi. The interfaces also need to work on smartphones, which of course have native vkbds. Thanks!

Mottie commented 8 years ago

Hi @Michael-F-Ellis!

There is a demo of this keyboard using jQuery Mobile v1.4.5. I haven't tried it on a Raspberry Pi, but I've heard of others that have done it.

Michael-F-Ellis commented 8 years ago

Nice! This may get me out of a corner I painted myself into. Thanks for creating and maintaining it.

Mottie commented 8 years ago

Hmm, that's odd... focusing on the input opens the keyboard, but only the first time. I'll take a look.

Michael-F-Ellis commented 8 years ago

Wow, predictive support! I was just about to ask for help with that? Could it be something to do with the destroy() call?

Michael-F-Ellis commented 8 years ago

The problem goes away if I comment out keyboard.removeKeyboard() in the :hidden() function. I tried looking at total document size using a sizeof() function I found at

http://code.stephenmorley.org/javascript/finding-the-memory-usage-of-objects/

No idea if the function is reliable, but it shows an increase of a few hundred bytes after each initial use of keyboard per input. Subsequent uses on the same element seem to leak about 10 bytes although that could be overhead from the DevTools console.

If that's as bad as it gets, my app could live with it. I'm monitoring total memory use of my processes behind the scenes and can restart them if they grow too large.

Is the keyboard part of the document? If not, then my measurements obviously don't mean much.

Mottie commented 8 years ago

The keyboard is attached to each input/textarea and cross-references through jQuery's data object, so I'm not sure about the accuracy of that report.

It shouldn't be a problem is the keyboard isn't removed since the reveal code does check if the keyboard already exists in the DOM. I haven't had a chance to mess with the code because of other stuff going on and I'm having graphics driver issues.

If you got it working, then great! I won't need to rush to figure out the problem.

Michael-F-Ellis commented 8 years ago

So far no reason to rush. I'm sure I'm going to have a few more questions about usage and layout. I do have it working in a prototype of my app using a copy of the script portion of your demo to define the widget. Would you prefer follow-on questions in separate issues, or should I continue to use this issue?

Mottie commented 8 years ago

I would prefer to Gitter. I may not answer right away, but it's easier to have a conversation and not add a lot of noise to this issue.