Search code examples
rokubrightscript

Is it possible to show the numbers entered in a roPinEntryDialog?


I have a Roku application using roPinEntryDialog, like so:

function EnterCode() as Boolean
    screen = CreateObject("roPinEntryDialog")
    mp = CreateObject("roMessagePort")
    screen.SetMessagePort(mp)
    screen.SetNumPinEntryFields(8)
    screen.SetTitle("Enter Code")
    screen.AddButton(0, "Next")
    screen.AddButton(1, "Cancel")
    screen.Show()

    while true
        msg = wait(0, screen.GetMessagePort())
        if type(msg) = "roPinEntryDialogEvent"
            print "Show Code: Index: ";msg.GetIndex();" Data: ";msg.GetData()
            if msg.isScreenClosed()
                return false              
            else if msg.isButtonPressed()
                token=screen.Pin()
                print "token: ";token
                if msg.GetIndex() = 0 then return true
                if msg.GetIndex() = 1 then return false
            endif
        endif
    end while
end function

When I use this dialog, it shows the entered numbers as asterisks. I tried using, screen.SetSecureText(false), but unfortunately that only works for text boxes. Is there a way to show the numbers inputted? If not, is there an alternative numerical dialog I should try that would?


Solution

  • Roku employee here.

    Cassidy, please be aware that the old SDK1 visual screen components are actually deprecated and inclusion of the components will lead a channel update to fail our certification as of January 2018. Additionally, the components will be removed from the firmware itself the following year. roPinEntryDialog is included in the list of deprecated components.

    While there is still to submit channel updates with SDK1 UI, you will eventually have to update the UI in SceneGraph. Given that you're already working on the channel, now may be an ideal time to work on converting the channel.

    As mentioned, I'd suggest using the PinPad, PinDiaglog, Keyboard, or KeyboardDialog nodes. If you're definitely locked in to using the old SDK1 model, then you could use roKeyboardScreen, but you'd have run the risk of having users input letters as well as numbers.