BUG | 4.16 COMBO BOX ENABLE GAMEPAD NAVIGATION MODE

In 4.15 my gamepad navigation worked fine but in 4.16 it does not work very well at all. Especially on the combo boxes. When using a Combo box string with Enable Gamepad Navigation checked when you select the drop down it drops down but you can not navigate it with a controller like you could in 4.15. You can control it with a gamepad but only if you click it with a mouse cursor first but even then you can not actually change the value of the combo box.

202485-capture.png

I read somewhere that this is a bug that is planned to be fixed in 4.19.

I’m guessing that until then we might have to create our own logic for the gamepads to navigate combobox options.

I noticed with the Enable Gamepad Navigation checkbox unticked, you can move up and down to get the different options while the combobox is not dropped down, and it can still navigate left and right to escape the combobox. So that might be a workaround if you don’t need all the dropdown options visible, only one at a time.

I fixed this by adding those 2 blocks to Engine\Source\Runtime\Slate\Public\Widgets\Views\SListView.h around line 290 :

....
}
else if (InKeyEvent.GetKey() == EKeys::Up || (bHandleGamepadEvents && (InKeyEvent.GetKey() == EKeys::Gamepad_DPad_Up || InKeyEvent.GetKey() == EKeys::Gamepad_LeftStick_Up)))
			{
				int32 SelectionIndex = 0;
				if (TListTypeTraits<ItemType>::IsPtrValid(SelectorItem))
				{
					SelectionIndex = ItemsSourceRef.Find(TListTypeTraits<ItemType>::NullableItemTypeConvertToItemType(SelectorItem));
				}

				int32 NumItemsWide = this->GetNumItemsWide();

				if (SelectionIndex >= NumItemsWide)
				{
					// Select an item on the previous row
					ItemNavigatedTo = ItemsSourceRef[SelectionIndex - NumItemsWide];
				}

				bWasHandled = true;
			}
			else if (InKeyEvent.GetKey() == EKeys::Down || (bHandleGamepadEvents && (InKeyEvent.GetKey() == EKeys::Gamepad_DPad_Down || InKeyEvent.GetKey() == EKeys::Gamepad_LeftStick_Down)))
			{
				// Begin at INDEX_NONE so the first item will get selected
				int32 SelectionIndex = INDEX_NONE;
				if (TListTypeTraits<ItemType>::IsPtrValid(SelectorItem))
				{
					SelectionIndex = ItemsSourceRef.Find(TListTypeTraits<ItemType>::NullableItemTypeConvertToItemType(SelectorItem));
				}

				int32 NumItemsWide = this->GetNumItemsWide();

				if (SelectionIndex < ItemsSourceRef.Num() - NumItemsWide)
				{
					// Select an item on the next row
					ItemNavigatedTo = ItemsSourceRef[SelectionIndex + NumItemsWide];
				}

				bWasHandled = true;
			}

Cool. I think there is a way to get your code into the next engine build, but not sure. If there is, you could fix the bug for everyone else!

I find it strange that this bit of code was in the engine before and then it was removed at some point for some reason that I don’t know.

Has anyone tried this in 4.19? It might be fixed by now.