I'm having a hard time getting a widget/component inside a custom component to get keypresses. I found that calling setFocus in the custom component's Init() doesn't fix this. Here's an example:
<component name="MyScreen" extends="Group">
vertFocusAnimationStyle = "floatingFocus" >
<ContentNode title="Label1" />
<ContentNode title="Label2" />
<ContentNode title="Label3" />
I've tried a number of ways to get the keypresses to move the item selection on the LabelList content and the only thing that seems to work for me is the following hack.
m.LabelGroup = m.top.findNode("Labels")
m.setFocusOnce = false
Function onKeyEvent(key As String, press As Boolean)
if not m.setFocusOnce then
m.setFocusOnce = true
After this, the focus stays on the LabelGroup and works as expected, but I have to call it once AFTER the init() for it to gain focus. What am i missing? Something regarding construction order or the nodes?