Get the information on which node triggered an event

Ok, I have a very simple PosterGrid:

What I want to do is process the OK key and get which node was clicked.

I read about roSGNodeEvent but I can’t find any example on how to use this, documentation is very lacking. I have:

FUNCTION onKeyEvent(key as String, press as Boolean) as Boolean

IF (press = false) THEN
What do i put here? is there a way to access the roSGNodeEvent here?

I want something that returns “node_X” depending on which Node the OK button was clicked.
END IF

END FUNCTION

In general, you don’t process key presses, you set up observers on events.

Sub init()
    m.menu_grid = m.top.findNode("menu_grid")
    m.menu_grid.observeField("itemSelected","onPosterSelected")
    ...
End Sub

Sub onPosterSelected(obj as Object)
    ' m.menu_grid.itemSelected has the index number of the poster selected
    ' as does obj.GetData()
    ' do your stuff here
End Sub

This is a core concept of Scene Graph that you’ll need to understand.

Awesome! This is exactly what I needed, thanks a lot.

To obtain information on which node triggered an event, you would typically cutting need access to the specific system or software that handles event tracking and logging.