roSearchScreen -> isScreenClosed()

Hi,

Roku ByDefault define Button UP and Back Button(2 and 0) for isScreenClosed() in roSearchScreen.

and there is no method for getting button index which is left side(msg.isButtonInfo()->msg.GetIndex() work for only right side).

In Non-legacy device case it is looking odd search box is closing on Up key also.

please suggest me how i can solve this Or how i can get button index for left side keyboard(for search screen) instead of use isScreenClosed().

Thanks in advance
(Chandra Prakash)

If Anybody have any idea please share.

What you could do is - check the search result.
ie

call your search routine as a function –

  1. msg.isListItemSelected()
  2. whatever check you use to determine it should pull up the search screen goes here
  3. Result=SearchScreen()

Then for your search screen function return a value
Function SearchScreen() As String
If msg.isFullResult()
If LEN(msg.GetMessage())>0 Then Return msg.GetMessage() 'if the search term value is greater than 0 characters, then return the search term to the calling function

And then jumping back up to the calling function,
4) If (Result<>invalid And LEN(Result)>0) Then
display the search results
else
screen was closed with the back, cancel, or up button because the search term was 0 bytes in length
end if

Just a side note - no idea when this will happen but Roku did announce they are dropping support for these older generation 1 boxes - not going to allow new channels to be put into the channel store for them.

The date has already passed IIRC

komag what do you mean by “The date has already passed IIRC” ?

Thanks destruk for reply .
Actually i am doing same thing. problem is that - how to catch individual index. suppose
i got 4 suggestion by searchPhrase.Len() > 2 like:

  1. delhi
    2)mumbai
    3)kolkata
    4)chennai

how to catch index 1) delhi which is in array 0 position. i want to block up button here.


In given keyboard by roku there is space key when we press it it gives " " . i want to block it also as validation purpose .
Can you suggest for this.
i am doing :-


				if msg.isPartialResult()
				         searchPhrase = msg.GetMessage()
					 if (searchPhrase=" ") 	
						screen.SetSearchTerms(history)
						screen.SetSearchTermHeaderText(searchHeaderText)
						screen.SetClearButtonEnabled(false)

					 end if
                               end if		

but what about when user press 2 or 3 or 4 …so on space before character . problem is that it count one character for space also when i do

if searchPhrase.Len() > 2

Thanks
(Chandra Prakash Jamloki)

I just mean the cutoff date for supporting old “classic” Rokus has passed now, so we no longer have to worry about them.

Generally Prakesh, you don’t want to deal with leading or trailing spaces for search terms. You can use .trim() to remove the leading/trailing spaces.
If all you want is to prevent it from accepting a search term with a leading space from a past history listing, then you can check the left character with this –

if msg.GetMessage().left(1)=" "

or

if result.left(1)=" "

or

result=result.trim()

Depending on what variable line you’re working with.

Hi Komag,
Actually i am doing in Roku 2 and Roku 3 version 5.1 and 5.2 .> I just mean the cutoff date for supporting old “classic” Rokus has passed now, so we no longer have to worry about them.
I have also a legacy device 3.1 , is it passed now?
where I can find the complete details about cutoff date for supporting old Rokus?

Thanks :slightly_smiling_face:

Thanks destruk for sharing your views.

I found the link:
http://support.roku.com/entries/9076593 … ku-Players

destruk your reply is satisfactory in case of trim().

But I am not understanding in case of :
Using SetSearchTerms() there are history or searchphrase appear.

How to catch individual index. suppose
i got 4 suggestion by searchPhrase.Len() > 2 like:

  1. delhi
    2)mumbai
    3)kolkata
    4)chennai

how to catch index 1) delhi which is in array 0 position. i want to block up button here.

When i am in 1) delhi and press up button here the screen gone close.
for this i am using

if msg.isButtonInfo()
print"key press search "msg.GetIndex()
but nothing will print in debug console when i am pressing remote key.

If I understand what you are asking, you would probably have to check the search history terms themselves -

history = CreateObject(“roSearchHistory”)
list = history.GetAsArray()
print "There are “; list.Count(); " items in the history”
print list[0]
searchterm=list[0].trim()
if LEN(searchterm)>0 then return searchterm

If it’s automatically closing when you hit up on the search history list, then you should check the length of the search term and if it’s 0, or invalid, loop back to redraw the search screen again so they have to exit by selecting a cancel button or something, or just ignore the issue.