Forum Discussion
3 Replies
- RokuJonathanDCommunity Moderator
Hi dan19,
The roSGnode.ifSGNodeFocus interface does not support checking which node last had focus. The channel code should keep track of the item from which the dialog was opened. For example, if the poster or rectangle was in array, you would have the index of the last selected item.
- dan19Binge Watcher
Thanks for taking the time to answer me. I have a dialog that is shown when the options key is pressed, and when the back key is pressed, the dialog closes. So I am trying to set focus to the last Item/node that was in focus before the options key was pressed. If there is no inbuilt method for this, what will be the best logic to tackle this?
Thanks.
RokuJonathanD wrote:Hi dan19,
The roSGnode.ifSGNodeFocus interface does not support checking which node last had focus. The channel code should keep track of the item from which the dialog was opened. For example, if the poster or rectangle was in array, you would have the index of the last selected item.
- sanity-checkRoku Guru
You can observe 'focusedChild' on any Node, that might help.
(Looking at my own code I have a lot of spaghetti around focus management so I don't recall exactly what the default behaviours are but if you're on the Roku UI happy path hopefully you won't need to lose too much hair.)