Your Digital Media Has Never Looked So Good

 
adrianc1982
Topic Author
Posts: 89
Joined: Thu Jun 05, 2014 6:02 pm

LabelList vs roListScreen

Wed Sep 28, 2016 3:11 pm

Is it me or roListScreen scrolls faster? I mean i click down or up pretty fast and roListScreen flies compared to LabelList

Im also having a problem scene graph when using onKeyEvent while scrolling down or up I doesnt seem to catch the down or up button. Until i reach the end of the list or the top i get the up or down button registered and no, im not using any IF statement thats blocking my keys, in fact im debugging with something like this:


    sub showcontent()
        print "selected"
        categorycontent = m.listMenu.content.getChild(m.listMenu.itemFocused)
        m.poster.uri = categorycontent.HDPosterUrl
        m.labelSeletectedItem.text = categorycontent.title
    end sub
    
    function onKeyEvent(key as String, press as Boolean) as Boolean
        print "key: "+key
        categorycontent = m.listMenu.content.getChild(m.listMenu.itemFocused)
        m.poster.uri = categorycontent.HDPosterUrl
        m.labelSeletectedItem.text = categorycontent.title
    end function

 
In case you are wondering yes, i had to put an observer to track down the change when i click the down button, when focus changes i can change my text or poster, but the onkeyevent wont detect the down or up keys until i reach the top or end of the list. All the other keys do get catched pretty fast with the onkeyevent.
Can i make the scrolling down faster when i click the down button on the remote controller? Maybe adjust the animation time or something?
 
User avatar
TheEndless
** Valued Community Member **
Posts: 9231
Joined: Mon Oct 04, 2004 10:15 am
Location: US
Contact:

Re: LabelList vs roListScreen

Sat Oct 01, 2016 1:52 pm

adrianc1982 wrote:
Im also having a problem scene graph when using onKeyEvent while scrolling down or up I doesnt seem to catch the down or up button.

That's the expected behavior with a focused component that handles the keypresses.  You get the keypress at the top and bottom of the list to give you the opportunity to change focus.  Take a look at Handling Remote Control Key Presses in the documentation for more info.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
 
User avatar
marcelo.cabral
Posts: 377
Joined: Tue Mar 20, 2012 8:53 am

Re: LabelList vs roListScreen

Sun Oct 02, 2016 6:32 pm

TheEndless wrote:
adrianc1982 wrote:
Im also having a problem scene graph when using onKeyEvent while scrolling down or up I doesnt seem to catch the down or up button.

That's the expected behavior with a focused component that handles the keypresses.  You get the keypress at the top and bottom of the list to give you the opportunity to change focus.  Take a look at Handling Remote Control Key Presses in the documentation for more info.

I was trying the same thing with roListScreen, it seems that Roku do not generate an event when in the top and key up is pressed and in bottom key down is pressed.
 
EnTerr
** Valued Community Member **
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: LabelList vs roListScreen

Sun Oct 02, 2016 6:58 pm

marcelo.cabral wrote:
I was trying the same thing with roListScreen, it seems that Roku do not generate an event when in the top and key up is pressed and in bottom key down is pressed.

Does it not produce "extraneous" isListItemFocused() events when in that position? I.e. receiving getIndex() = 1, 1, 1...
  • If it does, you can milk/use that.
  • If it does not, you can request the Co to enhance the behavior (but don't hold you breath long, couple of years ago i proposed them add PgUp/PgDn behavior of <</>> for roListScreen and ...  still haven't heard back).
 
adrianc1982
Topic Author
Posts: 89
Joined: Thu Jun 05, 2014 6:02 pm

Re: LabelList vs roListScreen

Mon Oct 03, 2016 3:48 pm

TheEndless wrote:
adrianc1982 wrote:
Im also having a problem scene graph when using onKeyEvent while scrolling down or up I doesnt seem to catch the down or up button.

That's the expected behavior with a focused component that handles the keypresses.  You get the keypress at the top and bottom of the list to give you the opportunity to change focus.  Take a look at Handling Remote Control Key Presses in the documentation for more info.

Thanks for your kind answer i will study those and come back with a reply. In the past roku development for me at least has been like hacking code I had to get really creative to achieve certain things and now im giving a shot to scene graph reading all the documentation and reading the forums but i think we need to keep posting about this "hacks" and how to get things done.
Expected behavior i get it but you could also just record the key up and down and keep an eye on your last item or first to change focus. Because waiting for showcontent() function is SLOW as flower.Thanks also for reading my rant.

Who is online

Users browsing this forum: No registered users and 7 guests