Download

Is there any way to give ListView widgets controller support?

Hi there.

I’m making a settings menu - as part of this, I use a ListView.
Each entry within the ListView is made up of a Text and 2 KeySelectors (one for gamepad keys).

Now, when I enter this screen using a controller, focus is immediately placed on the Back Button.

Moving up on the joystick moves focus to the Mouse Sensitivity Slider, then to the CheckBoxes, and then to the ListView itself, which accepts keyboard focus.

From here, two weird things happen:

  1. Moving the controller stick down results in focus being completely lost from the whole window. The ListView is set to Stop navigation in every direction except down, which points to the UpDownCheckBox. What is going on here?

  2. It’s impossible to select any of the Widgets within the ListView.

Does the ListView support controller/keyboard focus at all?

Hello I’m currently looking into this myself.
Did you ever figure it out? if so how?

I’ll share my findings as I explore.

I did manage to make it work.

Essentially, you have to handle input completely on your own.

If the listview gains focus from this input, then choose the most appropritate element within the list view.

if you input on a list view item, find and navigate keyboard focus to the desired element.

if the new list view item is out of scroll, scroll it into view.

you can use the bounds of the list view to escape, as when you hit the top or bottom items, the navigation rules will be called.

I highly recommend you use scroll boxes instead though…