Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe consider adjustments to fully support TV remotes (and possibly other devices)? #483

Closed
Dani3I opened this issue Apr 4, 2024 · 10 comments · Fixed by #529
Closed

Maybe consider adjustments to fully support TV remotes (and possibly other devices)? #483

Dani3I opened this issue Apr 4, 2024 · 10 comments · Fixed by #529

Comments

@Dani3I
Copy link

Dani3I commented Apr 4, 2024

App on TVs works fine except for the fact that most of TV remotes (or at my 2 remotes) don't have * and # buttons (I tested with the help of mouse).

Possible solutions I came up with:

  • Mapping other keys from remote to * and #. It would be great If these keys worked as * and # only when typing by tt9. I found in you docs something about mapping but I guess this is inside of android settings and it apperas that these settings are not avaiable for my TV's (or at least not to TV remotes). Possibility to map keys have for example SuperTuX Kart game on android and it is open source, so maybe you can take code from there (although some keys are not allowed to remap for some rason).
  • In QinBoard-T9, keyboard works in a way that when I start typing, it opens full screen text-box (at least on TV it works that way), and I can remove characters by clikcing beck button on my TV remote. So it allows me to remove charactes but there should be also possibility to change modes (big, small letters etc.) and I guess it would also require to assign some button to that action. Then user would be able to chose normal mode and this "full screen textbox mode" in settings.
  • And lastly, probably easiest way to implement (and probably that would allow to support any device with arrow keys and ok button, but at a cost of convenience): On standard qwerty keyboard on TV's everything is done with arrow keys and "ok" button. So maybe text could be inputed by numerical keyboard on TV remote, but it would be also possible to navigate on this already existing "on-screen keypad" by arrow keys and "ok" button. This would mean that it won't be possible to use directly arrow keys for suggestion/dictionary and it would be required select these keys on "on-screen keypad" and use "ok" button to use it. But, to kinda circumwet this, there also could be assigned button to switch modes of "arrow keys and ok button" between "suggestions" and "navigation of on-screen keypad".
@Dani3I Dani3I changed the title Maybe consider support for TVs ? Maybe consider adjustments to fully support TV remotes? Apr 4, 2024
@Dani3I Dani3I changed the title Maybe consider adjustments to fully support TV remotes? Maybe consider adjustments to fully support TV remotes (and possibly other devices)? Apr 4, 2024
@sspanak
Copy link
Owner

sspanak commented Apr 6, 2024

I found in you docs something about mapping but I guess this is inside of android settings and it apperas that these settings are not avaiable for my TV's (or at least not to TV remotes

Well, how did you activate Traditional T9 in the first place? You must have visited TT9 Settings -> Initial Settings. From the same place, but by going to Keypad -> Hotkeys you can reassign the function keys and use something else than * and #. You could, for example, use Volume Up/Down keys which are surely available on all remotes. The next release will also include support for Next/Previous Channel keys, so you should be able to get access to almost all functions easily.

Arrow keys are also supported on any device without extra configuration, but they are used to select suggestions or filter them.

Basically, all that you have requested is already there, except for the "navigation" mode, but I don't think it is necessary, if you can type with the number keys.

Btw, QinBoard-T9 is a Traditional T9 clone. Both projects started from the original TT9 project. QinBoard is still largely based on the old codebase with some optimizations to work on the Qin 1s phone and extended emoji support. But the general typing experience should be almost the same with both keyboards. I am not sure what is the full screen text box you are referring to.

@Dani3I
Copy link
Author

Dani3I commented Apr 7, 2024

I am not sure what is the full screen text box you are referring to.

When I type using tt9, text appear inside textbox that is showed by app I am writing inside. For example google textbox like this:
QuinT9 - 1
But when I start typing using QinBoard-T9, full screen "text box" appears which is created probably by QinBoard-T9 and text starts appearing there. For example when clicked on the same google text box as above, then this appears:
QuinT9 - 2
So this box disappears either when you click search or when all characters are removed by back button.


Well, how did you activate Traditional T9 in the first place? You must have visited TT9 Settings -> Initial Settings. From the same place, but by going to Keypad -> Hotkeys you can reassign the function keys and use something else than * and #. You could, for example, use Volume Up/Down keys which are surely available on all remotes. The next release will also include support for Next/Previous Channel keys, so you should be able to get access to almost all functions easily.

I must admit, I am sorry, I don't know how I even did it, but I didn't noticed this option and I searched for it 2 or 3 times. Anyway, I tested it on my 2 TV's and unfortunately it seems that Volume Up and Volume Down keys are exclusive to managing Volume (even when I add them as hotkeys, these are still working as volume buttons and are not doing things that I assigned them for).

Channel keys probably will be usable so it certainly helps, thank you. I noticed that Volume buttons do not have hold variants, will these have that?
On two "samples" of TV remotes I used these buttons were actually recognized as the same "Gamepad buttons" (as in tables below) so I guess this might be a standard, unlike colored buttons which for some reason are different.


I am not sure If you will be doing more buttons or allowing customs buttons to map, but I tried both of my remotes in super tux kart to test which keys can I assign and here are simple tables:

Remote 1:
All of these buttons are recognized as one input device inside super tux kart:

button on remote: supertux kart recognized it as:
Red "A" button Gamepad button 218
Green "B" button Gamepad button 219
Yellow "C" button Gamepad button 434
Blue "D" button Gamepad button 432
Up button DPad up
Down button DPad down
Left button DPad left
Right button DPad right
Ok button A
Back button B
Play/Pause button Gamepad button 240
Channel up button Gamepad button 435
Channel down button Gamepad button 436
Numbers {1,2,3,4,5,6,7,8,9,0} Gamepad button {35,36,37,38,39,40,41,42,43,44}
"Rec" (recording) button Gamepad button 207

Although something wired happens and when I close game and reopen it, then this input device is not detected anymore and only some keys are recognized as keyboard: numbers, arrows, OK button (as "Return"). Also play/pause button is recognized but as "?". Probably also back button works as "esc" because it closes window to assign keys. And only after full reboot, buttons are recognized as before (as gamepad buttons etc.) and are not recognized as keyboard.

On this remote "Rec" button is in place of "#" button, and other closest button would probably be "Channel down button".

Remote 2:
All of these buttons are recognized as one input device, EXCEPT ones that I wrote "standard keyboard", which are recognized as a keyboard buttons.

button on remote supertux kart recognized it as
"AUDIO" button Gamepad button 425
Numbers {1,2,3,4,5,6,7,8,9,0} standard keyboard
"INFO" button Gamepad button 391
"TTX" button Gamepad button 169
Up button DPad up
Down button DPad down
Left button DPad left
Right button DPad right
Ok button A
Back button Back
"EXIT" button Back
Channel up button Gamepad button 435
Channel down button Gamepad button 436
Red square button Gamepad button 199
Green square button Gamepad button 194
Yellow square button Gamepad button 443
Blue square button Gamepad button 250

On this remote "TTX" button is in place of "#" button, and "INFO" button is in place of "*" button.

@sspanak
Copy link
Owner

sspanak commented Apr 12, 2024

I am not sure If you will be doing more buttons or allowing customs buttons to map, but I tried both of my remotes in super tux kart to test which keys can I assign and here are simple tables...

Ugh, okay, so it isn't going to be so easy. It seems that, some of the buttons on the remotes, do not correspond to their actual Android functions. They probably did that, to prevent each remote from working with another TV. Here is the actual key code list for reference. As you can see the codes do not quite match your remotes. I can see even OK and Back are mismatched. Do they work properly in QinBoard?

I guess the only may of making TT9 compatible with any TV (or any device, for that matter), would be to allow full customization of the hotkeys, like in a game. It shouldn't be so difficult, but there are many other tasks in the pipeline, so it may take quite some time until I can get to this.

All of these buttons are recognized as one input device, EXCEPT ones that I wrote "standard keyboard", which are recognized as a keyboard buttons.

I didn't get that. What is a "standard keyboard" and is there a problem with these keys? Both the regular number keys and the numpad keys are available on a standard keyboard, and TT9 supports both.

when I start typing using QinBoard-T9, full screen "text box" appears which is created probably by QinBoard-T9 and text starts appearing there. For example when clicked on the same google text box as above, then this appears

I am almost 100% sure this is not part of QinBoard, but it is probably triggering your TV to do it. However, at the moment, there are some startup issues with TT9, that are going to be fixed in the next version. Let's wait until it is out and see if it works better.

@Dani3I
Copy link
Author

Dani3I commented Apr 12, 2024

I didn't get that. What is a "standard keyboard" and is there a problem with these keys? Both the regular number keys and the numpad keys are available on a standard keyboard, and TT9 supports both.

There isn't any problem with numbers on tt9 (both TV remotes number pads are working).
I just wote down how keys on my "Remote 2" are recognized in game, and in game, there is list of devices which looks like this:
e6931aa3-153f-4333-8612-8af3ecf08d5c

On my TV's list looks a little different, but only devices wchich keys can be recognized in suppertuxkart are: my TV-remote and "Keyboard 0". "Keyboard 0" device is recognizing numbers, and rest of keys are recognized by TV-remote device (which btw. have icon of gamepad like "Serafim S1" on screenshot)


As you can see the codes do not quite match your remotes. I can see even OK and Back are mismatched. Do they work properly in QinBoard?

I am not sure what is proper way of working, but "OK" works like "enter" and "Back" works like "backspace" If I remember correctly.


It seems that, some of the buttons on the remotes, do not correspond to their actual Android functions.

I am just speculating, and probably what you said is true, but maybe this might be a problem of supertuxkart way of showing information?
I didn't yet had enough time to test it properly (I don't have acces to any TV for now): but I stumbled on f-droid on app called KeyMapper by keymapperorg. And when I tried to map some keys, then this app was able to recognize more keys than supertuxkart (so for example, this app was able to recognize "PROGRAM" on my "Remote 1" which is in place of "*" key on standard t9 keyboard. This key, when pressend inside supertuxkart, was instantenously opening "Electronic Program Guide" on my TV) and names of keys were not "Gamepad button" but more descriptive - something like "Ok button" etc..
If I remember correctly, channel buttons were recognized as "Channel Up" and "Channel Down".
The reason why "KeyMapper" is able to recognize more keys is probably because "KeyMapper" needs access to accesibility features of android.

I guess the only may of making TT9 compatible with any TV (or any device, for that matter), would be to allow full customization of the hotkeys, like in a game. It shouldn't be so difficult, but there are many other tasks in the pipeline, so it may take quite some time until I can get to this.

It might be even less important (for me), because when I finally test "KeyMapper" properly, it might become a solution to me. It seems to support key mapping per app (so maybe I would be able to map some keys only in tt9). For now I don't know yet if app will be able to work with things "not fullscreen" like keyboard; also If it will continue to work after sleep/reboot on my TV - and I only tested recognition of some keys and only inside "KeyMapper" app. Another "problem" is that that development of "KeyMapper" stopped and they are looking for maintainers, so I am not sure if this would work on newer devices than mine.


If you want, when I will have access to TV's again, I can test these TV remotes in other app.

@sspanak
Copy link
Owner

sspanak commented Apr 16, 2024

That's a lot of information! But first things first, v30.0 is out, so please try it out and let me know if it works better. If you are using F-droid, you may need to wait until the end of the week. I can see they haven't detected it yet.

As for the game, I have no idea why is it displaying joysticks and keyboards like this. You may be better of using the KeyMapper app, indeed.

I am not sure what is proper way of working, but "OK" works like "enter" and "Back" works like "backspace" If I remember correctly.

Correct. My question is, do they work any differently (or are they ignored?) with QinPad or Traditional T9?

And second question, how do you control QinPad (e.g. change the language or switch between 123, ABC or predictive mode), if it also requires "#" and "*" keys?

@Dani3I
Copy link
Author

Dani3I commented Apr 16, 2024

As far as I remember clicking "back" key in tt9 just leaves app I am typing in (or maybe first closes keyboard) even when I assigned it as hothey in settings; and Ok key seemed to work as intended in tt9, so I can accept suggestions and when there is not suggestions it works like enter.

I wasn't able to switch modes and languages in QinBoard duiring typing (only in settings).

I won't be able to test anything on TV until next week (around Thursday) - so I will tell you in more details then (and check if what I said in this comment is correct).

@Dani3I
Copy link
Author

Dani3I commented May 6, 2024

Sorry for longer time than I said in previous message.


Correct. My question is, do they work any differently (or are they ignored?) with QinPad or Traditional T9?

(*)QuinBoard when clicking "Back" is removing character and only when there is no characters left it closes keyboard (tt9 just closes keyboard, but now when I assign back button (because now assigning "back" works) it works the same way). QuinBoard when clicking "OK" is closing keyboard which is probably not desired because I can't actually "send" text in some apps (I can't click on that search button that is visible on one of the screenshots I send before) - meanwhile tt9 (if there is no suggestion to accept) just "sends" text (so clicking OK actually invokes searching).

And I also confirm that I wasn't able to switch modes and languages in QinBoard duiring typing as I wrote in previous comment.


When it comes to newer version of tt9, I installed current newest version (v31): channel buttons are working so that is great. I can assign them on both TV remotes. When I assign back button now also is doing the action I assigned it to so that's great. Volume buttons are not working.


If someone wonders about KeyMapper: I cannot just assign TV remote buttons to "*" or "#" because KeyMapper works in a way that it uses its own keyboard to type these characters (so I would need to use keyboard (KeyMapper keyboard) to use another keyboard (tt9), which is not possible - or I don't know how to do it other way) BUT, I can instead assign buttons on TV Remote to make "touch" screen in certain coordinates. It works, but unfortunately I can only make it globally (so when I click assigned buttons on TV remote - it clicks in these positions of the screen even when I am not typing) because adding constraint in KeyMapper to make it work only when tt9 is in background, makes it actually work all the time (so I guess tt9 is always in background), and If I tried instead adding constraint in KeyMapper to make it work only when tt9 is in foreground - it stops working entirely (so I guess keyboard is not considered by android as foreground app when typing in android; or It doesn't work on TVs).
So solution with KeyMapper is not ideal either.


And here I also modified previous tables to show how KeyMapper recognizes keys on my TVs:

Remote/TV 1:

button on remote supertux kart recognized it as name shown by KeyMapper
Red "A" button Gamepad button 218 TV Red
Green "B" button Gamepad button 219 TV Green
Yellow "C" button Gamepad button 434 TV Yellow
Blue "D" button Gamepad button 432 TV Blue
"YouTube" button unknown keycode 2000
"HBO GO" button unknown keycode 2008
"prime video" button unknown keycode 2004
Up button DPad up Up
Down button DPad down Down
Left button DPad left Left
Right button DPad right Right
Ok button A DPAD Center
Back button B Back
Home button Home
Play/Pause button Gamepad button 240 Play/Pause
mute button Mute Volume
Channel up button Gamepad button 435 Channel Up
Channel down button Gamepad button 436 Channel Down
Numbers {1,2,3,4,5,6,7,8,9,0} Gamepad button {35,36,37,38,39,40,41,42,43,44} {1,2,3,4,5,6,7,8,9,0}
"PROGRAM" button unknown keycode 2011
"Rec" (recording) button Gamepad button 207 Media Record

Remote/TV 2:

button on remote supertux kart recognized it as name shown by KeyMapper
"AUDIO" button Gamepad button 425 unknown keycode 350
Numbers {1,2,3,4,5,6,7,8,9,0} {1,2,3,4,5,6,7,8,9,0} {1,2,3,4,5,6,7,8,9,0}
"INFO" button Gamepad button 391 Info
"TTX" button Gamepad button 169 TV Teletext
"INPUT" button TV Input
"CH list" button Button 9
"SET" button Settings
"NETFLIX" button Button 6
"prime video" button Button 7
Up button DPad up Up
Down button DPad down Down
Left button DPad left Left
Right button DPad right Right
Ok button A DPAD Center
"MI" button Button 5
Back button Back Back
Home button Home
"EXIT" button Back Back
"MUTE" button Mute Volume
Channel up button Gamepad button 435 Channel Up
Channel down button Gamepad button 436 Channel Down
Red square button Gamepad button 199 TV Red
Green square button Gamepad button 194 TV Green
Yellow square button Gamepad button 443 TV Yellow
Blue square button Gamepad button 250 TV Blue

EDIT: I edited sections about back button because either there is some inconsistency and sometimes it works and sometimes doesn't. Or I just configured/tested something wrongly (I still have some wired behaviour but only in play store so idk). Now back button seems to work (when I assign it to "backspace" it works).

@sspanak
Copy link
Owner

sspanak commented May 12, 2024

(*)QuinBoard when clicking "Back" is removing character and only when there is no characters left it closes keyboard (tt9 just closes keyboard, but now when I assign back button (because now assigning "back" works) it works the same way).

I edited sections about back button because either there is some inconsistency and sometimes it works and sometimes doesn't. Or I just configured/tested something wrongly (I still have some wired behaviour but only in play store so idk). Now back button seems to work (when I assign it to "backspace" it works).

Some applications can capture the Back key presses and use them for their own purposes, effectively preventing any keyboard from deleting text. This may be the reason it sometimes works as expected, but sometimes it doesn't. For this reason, I have added the possibility to assign the Backspace function to another key. See the manual for more info.

And here I also modified previous tables to show how KeyMapper recognizes keys on my TVs...

OK, the KeyMapper app makes more sense. I recommend not using Supertux Kart for probing the remote control keys.

QuinBoard when clicking "OK" is closing keyboard which is probably not desired because I can't actually "send" text in some apps (I can't click on that search button that is visible on one of the screenshots I send before) - meanwhile tt9 (if there is no suggestion to accept) just "sends" text (so clicking OK actually invokes searching).

This sounds right. OK either selects a suggestion or performs the expected action (e.g. sending the text).

Volume buttons are not working.

I am not sure why is that. You didn't include them in the tables above, so I can't comment.

Now that you have provided the results from KeyMapper, I can add support for Mute, the colored keys and maybe some other standard keys, if you think that would be useful. This is to compensate for the missing * and #. If Back misbehaves in some apps, you would be able to re-assign it from TT9, too.

Other than that, it sounds to me that TT9 is working fine. Or am I missing something?

@Dani3I
Copy link
Author

Dani3I commented May 21, 2024

You didn't include them in the tables above, so I can't comment.

This is because these buttons only always change the volume and are not recognized by KeyMapper.

I can add support for Mute, the colored keys and maybe some other standard keys

These keys seems to be fairly common, and could be useful if someone would want to assign other hotkey actions to some keys or if in someones layout these buttons are closer to numpad; but for me personally, this is not necessary, channel keys should be enough for me. So it depends if you want to add them.

Other than that, it sounds to me that TT9 is working fine.

Yeah, I think so. Thanks for all responses and fixes.

@sspanak sspanak linked a pull request May 30, 2024 that will close this issue
@sspanak
Copy link
Owner

sspanak commented May 31, 2024

OK, I will add support for some extra keys and close the issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants