yourealwaysbe / forkyz

Forkyz Crosswords
GNU General Public License v3.0
39 stars 5 forks source link

Add support for native keyboards #45

Closed Mpk320 closed 2 years ago

Mpk320 commented 2 years ago

The option to use the native keyboard instead of the in app one seems to have been removed, it's a nice feature to have

yourealwaysbe commented 2 years ago

I removed it partly to avoid having to maintain two different systems, and partly because the app's built on key events, and Android on-screen keyboards are not:

you should expect that such keyboard events come only from a hardware keyboard. You should never rely on receiving key events for any key on a soft input method (an on-screen keyboard).

I think in many cases it works ok, but in others it goes a bit wrong (e.g. #16). I was also never quite happy with the show/hide behaviour of the native keyboard (i used to use it) -- the signals you had to send to get it to show/hide were not quite reliable.

The on-screen keyboards are designed for editing text (the auto-complete is built around replacing chunks of text). It would be nice to set up the crossword grid so it acts like a kind of text box that works with the Android input system, but i think it's not a straightforward task.

I think at this point i'd be happy to accept a pull request putting the native keyboard back. One day i might do it myself. But it would be the kind of feature that comes with a health warning as it can't be made to work reliably as it was previously written (but could be with an overhaul of the input system).

jancborchardt commented 1 year ago

@yourealwaysbe just wanted to say big thanks for adding the native keyboard option! :) Misclicks on the custom keyboard were a big annoyance (especially as I like to go for quick solve times), and this seems to not be an issue anymore. Very much appreciated! :heart:

yourealwaysbe commented 1 year ago

Thanks :)

Let me know if it behaves weirdly in any cases. I tried to do it using the Android IME stuff properly, rather than relying on the keyboard reporting key events (which Android docs warn against). But the docs also warn to test widely when trying to handle IMEs. As a result there could be bugs lurking (and i found bugs in two keyboards on FDroid while testing).