Salamek / chromium-kiosk

Chromium kiosk is simple package turning your Archlinux or Debian (and alike) based PC/Raspberry into simple web kiosk using chromium.
GNU General Public License v3.0
60 stars 10 forks source link

Virtual keyboard functionality and customization #98

Open kosmosnautti opened 1 month ago

kosmosnautti commented 1 month ago

So far this project has worked wonderfully, but I've come across a small problem regarding the virtual keyboard when using this with a touch screen.

I have a website using basically the whole size of the web view window. I also have input fields on different parts of the screen, and the problem is that whenever I click on a field that's on the lower part of the screen, the virtual keyboard pops up (as expected) and blocks the view to the actual input field of the website, so the problem is that I cannot see what I'm typing into the field.

I was thinking if it would be possible to add an option to for example resize the web view window when the virtual keyboard is opened (so that the web view window would be resized to start from the top of the screen and end at the top of the virtual keyboard), and then possibly scroll (if needed/possible) the web view window to the clicked input field, so that the field would be visible while typing? That's just the first solution that came to my mind, perhaps there are more elegant ones.

And last but not least, not an issue per se but more of a feature request: Would it be possible to also add some customization options for the virtual keyboard? What I'd like to see for example:

Salamek commented 1 month ago

Well this will needs some R&D, there are like 3 ways how to do/fix this, none of them easy to implement:

  1. Keep using QWidgets, listen for virtual keyboard events and offset PageView up (+vkb height) without changing its w/h (to not change page layout, responsive css exists) and scroll to focused input, revert that when vkb is closed.
  2. Rewrite qiosk to use QML, then embed the QML vkb into qiosk, that allows to override bunch of things etc but i don't want to really do that
  3. Render floating input on top of vkb to display what is written

I think i will go with 1 for now... Also qvirutalkeyboard uses system settings for input locale

kosmosnautti commented 1 month ago

Yeah, nbr. 1 on your list sounds reasonable. Didn't even think about responsive pages when I wrote the initial message, but you're right, the actual webview viewport size is best to be kept the same whether the virtual keyboard is open or not, just change the position of it on the screen. Looking forward for the enhancement!