Forum Discussion
destruk
9 years agoStreaming Star
Alright - so this works.
Double up the variables and routines. Have the user enter a letter or number for the keyboard with their remote and add that value to both variables.
Then retain the one you want to use, and truncate the second copy and kick it back to the screen - something like m.fieldText2.text=Right(newText,50)
It's confusing but it works.
To explain this better we'll go slow -
Create your keyboard screen.
Set up your variables like you are using now - which works to enter characters into the field.
Double the field you are using for the entry string in the xml -
<field id="fieldText" type="string" value="" onChange="setFieldText" />
<field id="fieldText2" type="string" value="" onChange="setFieldText2" />
Double the child in the xml -
<Label id="fieldText" color="0x101010FF" font="font:MediumBoldSystemFont"
horizAlign="left" vertAlign="center" translation="[4,0]" />
<Label id="fieldText2" color="0x101010FF" font="font:MediumBoldSystemFont"
horizAlign="left" vertAlign="center" translation="[4,0]" />
In the brs script double the routine callback -
m.fieldText=m.top.findNode("fieldText")
m.fieldText2=m.top.findNode("fieldText2")
Then when the user selects a key, add the key value to the main string, and add the key value to the copied string, but only display back the right characters of the second string.
Double up the variables and routines. Have the user enter a letter or number for the keyboard with their remote and add that value to both variables.
Then retain the one you want to use, and truncate the second copy and kick it back to the screen - something like m.fieldText2.text=Right(newText,50)
It's confusing but it works.
To explain this better we'll go slow -
Create your keyboard screen.
Set up your variables like you are using now - which works to enter characters into the field.
Double the field you are using for the entry string in the xml -
<field id="fieldText" type="string" value="" onChange="setFieldText" />
<field id="fieldText2" type="string" value="" onChange="setFieldText2" />
Double the child in the xml -
<Label id="fieldText" color="0x101010FF" font="font:MediumBoldSystemFont"
horizAlign="left" vertAlign="center" translation="[4,0]" />
<Label id="fieldText2" color="0x101010FF" font="font:MediumBoldSystemFont"
horizAlign="left" vertAlign="center" translation="[4,0]" />
In the brs script double the routine callback -
m.fieldText=m.top.findNode("fieldText")
m.fieldText2=m.top.findNode("fieldText2")
Then when the user selects a key, add the key value to the main string, and add the key value to the copied string, but only display back the right characters of the second string.