Page 1 of 2

Android 9 TV Box: acting on remote control

Posted: Fri Jul 09, 2021 10:52 am
by trevix
I am deploying a LC 9.6.3 standalone in a Android 9 TV Box (T9 RK3318), that runs very well.
As you may know, beside attaching a hardware keyboard, or use the infrared remote control "mouse" mode, in most TV box you can go from button to button or field to field using the left/top/right/bottom commands of the infrared remote control.

I haven't figured out how i can intercept in LC these command and act accordingly on the UI.
Somebody has been able to do it?

Re: Android 9 TV Box: acting on remote control

Posted: Fri Jul 09, 2021 11:04 am
by Klaus
Maybe you can handle the "focusin" message somehow?
IF that message is being sent here...

Re: Android 9 TV Box: acting on remote control

Posted: Fri Jul 09, 2021 12:43 pm
by trevix
Before the control can receive a FocusIn, I should be able to focus on it (using what I found to be named D-Pad). And it doesn't.
I guess this stuff should be coded:
https://developer.android.com/training/ ... navigation
Out of my knowledge possibilities

Re: Android 9 TV Box: acting on remote control

Posted: Fri Jul 09, 2021 10:20 pm
by AxWald
Hi,

just to be sure: This doesn't shows anything?

Code: Select all

on rawkeydown what
   answer what
end rawkeydown
Have fun!

Re: Android 9 TV Box: acting on remote control

Posted: Sat Jul 10, 2021 1:18 pm
by trevix
No.
Both on the Tv box and on a Android 7 phone the rawkeydown does not react.
The native field takes control, I guess
Being able to code this navigation may open up a market for LC on android TV and android TV box: games, utilities , etc.
I thin LC should do an LCB extension for it

Re: Android 9 TV Box: acting on remote control

Posted: Sun May 28, 2023 8:06 pm
by trevix
Strange enough, the back key on the remote control reaches the "backKey" message in LC, like if using the cell hardware back button.
Also, LC answer and ask dialogs behave perfectly on the Android TvBox: you can navigate, using the remote wheel, from the field to the OK and Cancel buttons and back.

So, apparently, what is sent from the infrared remote does reach the LC engine.
Could it just be that there is a way to make it work but I don't know how?
I tried to look at the code of the ask and answer dialog, but I could not find a clue.

Re: Android 9 TV Box: acting on remote control

Posted: Mon May 29, 2023 4:52 pm
by jacque
Since the backkey works, maybe an arrowkey handler would work too?

Re: Android 9 TV Box: acting on remote control

Posted: Mon May 29, 2023 6:02 pm
by trevix
No. Nothing.

BackKey: OK
arrowKey: no
rawkeyDown: no
rawkeyUp: no
keyDown: no
keyUp: no
no other buttons on the remote has any effect (except of course for home and shutDown) on LC
Amazing

Re: Android 9 TV Box: acting on remote control

Posted: Mon May 29, 2023 7:34 pm
by jacque
Well, that's disappointing. ๐Ÿ™

Re: Android 9 TV Box: acting on remote control

Posted: Mon May 29, 2023 9:34 pm
by trevix
Yeah. But what is bizarre, as I said, is that left/right/focus select from the remote works fine inside the ask and answer LC dialogs.
There is a lot of code in this dialogs that I donโ€™t understand. But I wonder if I could duplicate that stack and transform it for my own use.

Re: Android 9 TV Box: acting on remote control

Posted: Wed May 31, 2023 4:13 pm
by trevix
I did a test (spoiler: it doesn't work)
Since the Answer/ask dialogs are listed on the standalone setting inclusions, probably they have code in the engine that allow them to respond, as they do, to infrared remot control, for navigating between buttons focus, field, etc. for reasons that escape me.

So I created a copy, with a different name, of the IDE "Answer dialog" stack, and I set it as a substack of a main stack.
I did some minor change to the code, removing a command which I don't understand but mainly acts on stack closing, that get sent to the revIDELibrary

Code: Select all

  if the environment is "development" then
      send "ideMessageSend" && "ideAnswerDialogClosed" to stack "revIDELibrary" in 0 millisecs
   end if
Unfortunately, opening the stack as modal, works as a regular modal stack but does not responde to the remote control.
Any knowledge guy can clear the light on this or make some suggestions?

I attach the stack, in case you care.
Thanks

Re: Android 9 TV Box: acting on remote control

Posted: Wed May 31, 2023 5:16 pm
by jacque
I remember when mobile was first developed, LC said they had to create specialized ask and answer dialogs. There must be more to it than just the stack. If LC is calling out to the OS then that would explain why the remote works there but not otherwise.

Re: Android 9 TV Box: acting on remote control

Posted: Fri Mar 22, 2024 1:45 pm
by Klaus
kideveloper11 wrote: โ†‘
Fri Mar 22, 2024 1:29 pm
On an Android 9 TV Box, commands from a TV remote control can be intercepted by using the mobile control message in LiveCode.
Well, we have already been this far actually... 8)

Re: Android 9 TV Box: acting on remote control

Posted: Fri Mar 22, 2024 2:02 pm
by SparkOut
Not even a mention of using accelerometer to catch TV remote messages. Perhaps*this time* it really is genuine :lol: :lol: :lol: :lol:

Re: Android 9 TV Box: acting on remote control

Posted: Fri Mar 22, 2024 3:05 pm
by Klaus
I've checked the user, he/she already made some vaild postings a long time ago.
But I might repeat myself, I have an eye on everything here! :D