sspanak / tt9

A T9 keyboard for Android devices with a hardware keypad.
Apache License 2.0
200 stars 35 forks source link

Pressing the number keys causes the Choose Default Keyboard popup to appear #490

Closed maverick74 closed 2 months ago

maverick74 commented 3 months ago

Ok... maybe I'm missing something here but on v30 - on the onscreen keypad -, if I disable the t9 dictionary and try to write an "x" (by double pressing key "9" twice to get "x"), instead I now get a popup to choose the default keyboard!

Is this how it's suppose to be, or am I missing something?

sspanak commented 3 months ago

This is wrong, absolutely.

It sounds like the hotkeys have become messed up for some reason. Could you please try going to Settings -> Keypad -> Select Hotkeys, then readjusting the "Change Keyboard" key? Just assign something, then restore your original selection. If this doesn't help, you could try resetting all keys, then reassigning them. Finally, try restarting your phone.

And if all fails, please, report back. We'll try to look for an alternative solution.

P.S. I have edited the title to reflect better the problem. I hope that's OK with you.

maverick74 commented 3 months ago

P.S. I have edited the title to reflect better the problem. I hope that's OK with you.

of course i'm ok with the change :) But... Well, it's not just the "9-key". It's any numbered key (i gave the "9 key" as an example)

Assigning a key (volume up, for example), does stop the "Change Keyboard" from popping up... but now i can't type the second letter, just the first!

Also... if i then restore the original selection (which was none / "--") the reported bug reappears.

Resetting the shortcuts was my first guess but it didn't work. Neither did restarting the phone

sspanak commented 3 months ago

Please try this APK. When you install it, it will say it is v30.0 again, but there is a small change in the on-screen keypad code.

If you are still unable to type, go to Settings -> Appearance and change the layout to "Function keys", then go back to an app where you can type and hit backspace. Then go back to the settings and restore the layout to a full on-screen keypad.

After doing this, are you able to type normally? Also, are you sure the problem is only with ABC mode?

If the problem does not go away, could you please try holding the Input Mode key (the one with the keyboard), or holding any number key? Do they react correctly?

As far as I remember, you are using a touchscreen phone, without hardware keys, right? If not, I am looking at the wrong file. :slightly_smiling_face:

maverick74 commented 3 months ago

Please try this APK. When you install it, it will say it is v30.0 again, but there is a small change in the on-screen keypad code.

I was unable to install it on the first try. It returned a popup saying it could not be installed, which was weird... On the second try, it did install ok, but the "change keyboard popup" problem is still present

If you are still unable to type, go to Settings -> Appearance and change the layout to "Function keys", then go back to an app where you can type and hit backspace. Then go back to the settings and restore the layout to a full on-screen keypad. After doing this, are you able to type normally?

No. The problem still persists!

Also, are you sure the problem is only with ABC mode?

Yeap. It's ABC-mode specific! All other modes work ok.

As far as I remember, you are using a touchscreen phone, without hardware keys, right? If not, I am looking at the wrong file. 🙂

Yes, it's a touchscreen phone. The only hardware keys i have are volume keys and the Lock/unlock key (bellow volume). This is my phone: https://www.gsmarena.com/xiaomi_redmi_5-8768.php

sspanak commented 3 months ago

OK then, maybe the installation didn't go properly. Please try this APK. The version is 30.62, but don't mind the number, it is just something different than 30.0. After installing it, please verify it has installed properly, by going to TT9 Settings and scrolling to the bottom, where you can see the version number.

Yeap. It's ABC-mode specific! All other modes work ok.

I can understand if the number keys cause the problem in all modes. There was a small mistake, that could potentially lead to this, if the phone begins registering "hold" instead of short "tap" events all the time. Detecting a touch is a bit of a magic sometimes. But there is no code that would cause this only in one typing mode. I am completely puzzled.

The only ABC-specific new thing in v30.0, is the timeout, which can now be fine-adjusted, instead of being on/off. You can try changing it, by going to Settings -> Keypad -> ABC Mode (at the bottom), then, from the dropdown, try selecting the maximum or the minimum values. I really doubt it will change anything, but there is no harm in trying.

I have the feeling the entire application became corrupted somehow. If it is the case, I cannot think of any other solution, but uninstalling and reinstalling. If you have any custom words that you would like to preserve, export them and upload them here. I'll include them in the mainline dictionaries in the next version.

I have tried upgrading back from v28.0, but I am unable to reproduce it on my side, so I am out of ideas, unfortunately.

maverick74 commented 3 months ago

OK then, maybe the installation didn't go properly. Please try this APK. The version is 30.62, but don't mind the number, it is just something different than 30.0. After installing it, please verify it has installed properly, by going to TT9 Settings and scrolling to the bottom, where you can see the version number

I have the feeling the entire application became corrupted somehow. If it is the case, I cannot think of any other solution, but uninstalling and reinstalling.

I could not install the new version so i ended up removing the old one in order to be able to install 30.62. After removing 30.0, 30.62 installed ok!

Now, in the new version, the "choose keyboard" popup does not appear. But now i can't type "X"! I can't pass beyond "W", the first letter. This happens for any other numbered key.

So, this is not the solution, i'm afraid...

If you have any custom words that you would like to preserve, export them and upload them here. I'll include them in the mainline dictionaries in the next version.

no point in saving them, there is no import feature and they definitely do not belong in the dictionary!!!

I'm going to have to add them manually all over again...

maverick74 commented 3 months ago

I also noticed I can no longer access settings from the keyboard button!

edit: neither can I add new words...

maverick74 commented 3 months ago

Ok... here is an update of what I've found. I've removed and installed this a few times and tried different approaches!

I don't exactly know what I did but now I on longer get the choose keyboard popup!

Now I can't get the any other letter beside the first on AB mode and I can't get into settings or add words

however if I go to settings (from the desktop icon) - languages - exclude words i am able to add words and also use the settings button! Double-tap a numbered key asks to add word!!!

This only happens on keyboard settings!!!

What a nasty bug... I suppose this is local problem...

after I remove the keyboard, how can I be sure nothing was left behind??? Some settings or something???

maverick74 commented 3 months ago

Here's a clue:

I've reset all shortcuts, set them all to null/-- and then change "next suggestion" to something not null (e.g. Call)

and now I can access any letter on Abc mode! I still didn't find a workaround to add new words or access settings from the keyboard button... (these last two functions still work fine on "exclude words" field!)

edit: all this in the original released v30.0 edit2: v30.62 has the same behavior!

I now suspect on something from the shortcuts...

sspanak commented 3 months ago

What a nasty bug... I suppose this is local problem...

I really hope so. It is quite serious indeed.

however if I go to settings (from the desktop icon) - languages - exclude words i am able to add words and also use the settings button! Double-tap a numbered key asks to add word!!! This only happens on keyboard settings!!!

So... you are saying the bug has different manifestations in different apps? Are you always testing in the same app? Is the same in some common apps, where I can also test, like YouTube, Chrome, SMS?

after I remove the keyboard, how can I be sure nothing was left behind??? Some settings or something???

By definition, Android keeps all the files of a given app in a single folder. When you uninstall it, it just deletes that folder and everything is gone. I haven't done anything funky, so Traditional T9 should leave no traces after uninstalling.

sspanak commented 3 months ago

I now suspect on something from the shortcuts...

I still suspect the touch events are detected incorrectly. I would like to rule out this option first.

I have built two new APKs for you to test: v30.3 with R8 and v30.3 without R8. Please try the R8 one first and make sure the hotkeys are reset to default.

If both APKs work, it means the touch events were not handled correctly. If only the one without R8 optimization works, then the R8 optimizer is optimizing the code a bit too much, causing it to run incorrectly on your device. If both APKs do not work, I'll review the hotkeys and the ABC mode code again.

maverick74 commented 3 months ago

I have built two new APKs for you to test: v30.3 with R8 and v30.3 without R8. Please try the R8 one first and make sure the hotkeys are reset to default.

OK... neither worked... :(

It behaves differently inside the TT9 configs vs any other app (firefox, unote, qksms, f-droid, etc).

also... i tried to downgrade to v.29 and v.29 presented the same problems - which before was working fine. I'm quite puzzled about this... a while ago, if i'm remembering correctly, we've faced something similar. I don't recall the issue or how exactly we fixed it...

maverick74 commented 3 months ago

Ok! Got it working!

maverick74 commented 3 months ago

I think you better keep this info somewhere as it might affect other models (at least the ones from Xiaomi)

Adding words and accessing configs from the keyboard: this is fixed by granting permissions to storage and, well, all other permissions available in the Android's app info page (os settings - applications - manage applications - tt9) this was lost when I removed the app and I didn't remember about setting them again

now, accessing the second, third and fourth letter on the keypad: the only solution I've found was to set the "Next Suggestion" shortcut to something else than null!

I tested this on v30.0 (the one released officially)

(oh, and sorry for all the spam here! I shared info as I was finding it hoping it could, somehow, help you...)

sspanak commented 3 months ago

now, accessing the second, third and fourth letter on the keypad: the only solution I've found was to set the "Next Suggestion" shortcut to something else than null!

I think I got it too, setting "Next Suggestion" to NULL is the key. Would you please uninstall again, then install and test v30.8? And please, do not change any permissions the first time you test. I would like to confirm they do affect the hotkeys indeed.

oh, and sorry for all the spam here! I shared info as I was finding it hoping it could, somehow, help you...

This is not spam, this is help. See, I do my best, but I'll never be as effective as an experienced QA, who just knows how to break everything while testing. And I can't afford to hire one. This is why I occasionally miss such very very specific scenarios that lead to weird bugs.

maverick74 commented 3 months ago

I think I got it too, setting "Next Suggestion" to NULL is the key. Would you please uninstall again, then install and test v30.8?

OK, so, now the second letters on the keypad all work as expected (without having to change anything on the "Next Suggestion" shortcut)

And please, do not change any permissions the first time you test. I would like to confirm they do affect the hotkeys indeed.

About this: it didn't work so i had to set the permissions again.

This time, however, i tested it a bit more! The problem is in the "Show Pop-up windows when running in the background". we have to allow it... If this is set it works ok.

sspanak commented 3 months ago

I assume you are talking about this. It seems to be a Xiaomi-specific. I don't have it on any of my phones and I have no idea what it does exactly. I didn't even know Xiaomi added so many extra permissions.

Do the keys work properly if you enable only that, but disable the file/multimedia permission? The file permission is only required for saving the dictionary export, but shouldn't affect key press processing. I will certainly update the manual, but I want to make sure to put the correct instructions there. That's the reason I am asking. Also, besides, the "Display pop-up when running in the background", I suppose "Show on lock screen" and "Display pop-up window" are mandatory too, right?

Finally, thank you for the persistence and for helping with this strange problem. I would have never figured it out myself. At least not without a Xiaomi phone.

maverick74 commented 3 months ago

I assume you are talking about this. It seems to be a Xiaomi-specific. I don't have it on any of my phones and I have no idea what it does exactly. I didn't even know Xiaomi added so many extra permissions.

Yes, that's the option! They added a bunch of "extra" things to the standard android (some good, some ... well... not so good). They added so many, that they now ship their own android version named HyperOS (pretty much like Huawei did with HarmonyOS but to a lesser degree...)

Do the keys work properly if you enable only that, but disable the file/multimedia permission?

Yes, i've been working with the storage permission (file/multimedia) disabled and i don't have any problems so far. It's works fine this way. It's only when i try to export the added words, that it asks me for granting permission to access storage!

Also, besides, the "Display pop-up when running in the background", I suppose "Show on lock screen" and "Display pop-up window" are mandatory too, right?

I don't have a "Display pop-up window", but i do have something called Permanent notification (to show permanent notifications), which i assume maybe the same thing. I tried disabling this one (which was on by default!), but tt9 kept working normally... it may affect it in some place i didn't test, however... but in my test i found no problem in blocking it.

"Show on lock screen" is not mandatory. It seems to work fine with it blocked. I have my lock screen blocked with a pattern, but i tried it with a pin and with a word to see if tt9 was used. Turns out that - at least in my model - it uses it's own keyboard for the lock screen (ignoring what is set for use inside android itself)

So, all in all, all i needed to change "manually" was to allow "Display pop-up when running in the background" in order to get it working.

Finally, thank you for the persistence and for helping with this strange problem.

No problem at all!!! Glad i can help :). If there is anything else you need me to test, just say so!

oh, and it is me that need to thank you for your work :)!!!

sspanak commented 3 months ago

Yes, i've been working with the storage permission (file/multimedia) disabled and i don't have any problems so far. It's works fine this way. It's only when i try to export the added words, that it asks me for granting permission to access storage!

This is how I meant it to be. All good on this side.

I don't have a "Display pop-up window", but i do have something called Permanent notification (to show permanent notifications), which i assume maybe the same thing. I tried disabling this one (which was on by default!), but tt9 kept working normally... it may affect it in some place i didn't test, however... but in my test i found no problem in blocking it.

Great... they have different permissions in the different versions...

Dictionary loading progress is displayed as a permanent notification. Just in case, I'll add this one to the manual as well. Thanks for pointing out this permission too.

"Show on lock screen" is not mandatory. It seems to work fine with it blocked. I have my lock screen blocked with a pattern, but i tried it with a pin and with a word to see if tt9 was used. Turns out that - at least in my model - it uses it's own keyboard for the lock screen (ignoring what is set for use inside android itself)

Yes, but there were reports TT9 gets activated on the lock screen on SH-01J and some unknown Kyocera model. It might be the case for some Xiaomi model. I am not taking any chances!

So, all in all, all i needed to change "manually" was to allow "Display pop-up when running in the background" in order to get it working. ... Glad i can help :). If there is anything else you need me to test, just say so!

I think we are all good now. Keep using the beta APK I've sent to you. You will be able to upgrade to v31.0 normally, when it comes out. If you are planning to install from F-droid, well, you will have to uninstall.

On my side, the code is now fine, so I'll just add a section about Xiaomi in the manual. If I got everything correctly, the "Display pop-up... " permissions is a must. The file permission, TT9 will ask when it needs it. And the rest from the screenshot, I'll pick the ones that look important and will note it is recommended to enable them just in case. You never know. Does it sound good?

maverick74 commented 3 months ago

Does it sound good?

Yes, it's sounds good! I think we hammered all the needed nails on this :)

maverick74 commented 3 months ago

I was about to open a bug... but this is such a tiny insignificant detail that I'll just leave it right here:

on Settings - Keyboard - Predictive mode you're missing an "L" (it's "Letras") in the Portuguese translation

IMG_20240422_010004

sspanak commented 3 months ago

It's OK to open new bugs for things like this, no worries. It's a silly copy-pasting mistake, I'll fix it in the next release.

By the way, if you spot any other spelling mistakes or translations that are completely wrong, feel free to suggest more improvements. This is the file. You can directly edit it on Github and open a pull request.

I don't speak Portuguese, so I translate everything with Google and use my knowledge in French to adjust the sentences a bit, but as you can imagine this is suboptimal.