Page 1 of 1

Gamepad Trigger inside ListBox

Posted: 09 Feb 2026, 18:18
by ttermeer-reboundcg
We have a simple ListBox to select an item. I am trying to setup a gamepad button to trigger a command. Everything works fine when using InputBindings but I cannot get GamepadTrigger to work.
I am guessing it is because, the behavior is set on the ListBox itself which is not focused but I don't know how to move it to the ListBoxItem instead.
			<ListBox ItemsSource="{Binding Rewards}" SelectedItem="{Binding SelectedReward, Mode=TwoWay}" 
					 ItemContainerStyle="{StaticResource BoosterTemplate}" KeyboardNavigation.DirectionalNavigation="Cycle"
					 >
				<ListBox.ItemTemplate>
					<DataTemplate>
						<Grid>
						<!-- display item -->
						</Grid>
					</DataTemplate>
				</ListBox.ItemTemplate>
				<b:Interaction.Triggers>
					<noesis:GamepadTrigger FiredOn="ButtonUp" Button="Accept">
						<b:InvokeCommandAction Command="{Binding TakeCommand}" />
					</noesis:GamepadTrigger>
				</b:Interaction.Triggers>
				<ListBox.InputBindings>
					<KeyBinding Key="Enter" Command="{Binding TakeCommand}" />
					<KeyBinding Key="Space" Command="{Binding TakeCommand}" />
				</ListBox.InputBindings>
			</ListBox>

Re: Gamepad Trigger inside ListBox

Posted: 09 Feb 2026, 21:01
by hcpizzi
Hi!

Controller key codes are not mapped by default. To use controller inputs with Noesis, you have to go through the EnahancedInput subsystem. The plugin contains a set of InputActions, one for each of the Gamepad key codes. There's also an InputMappingContext with default mappings, but you're free to use your own. The part that matters are the actual InputActions. You also have to check the Enable Actions box on your NoesisView class' Class Settings.

Please, let us know if this resolves your issue.

Thank you!

Re: Gamepad Trigger inside ListBox

Posted: 10 Feb 2026, 00:01
by ttermeer-reboundcg
Those are already setup and it works as intended everywhere else. The issue is only with ListBox Items when trying to add a gamepad trigger.

Re: Gamepad Trigger inside ListBox

Posted: 10 Feb 2026, 10:11
by ttermeer-reboundcg
Also tried settings the trigger in the ItemContainer style like so :
			<Style x:Key="BoosterTemplate" TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource FRRDefaultControlStyle}">
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate TargetType="{x:Type ListBoxItem}">
							<!-- custom template -->
						</ControlTemplate>
					</Setter.Value>
				</Setter>
				<Setter Property="noesis:StyleInteraction.Triggers">
					<Setter.Value>
						<noesis:StyleTriggerCollection>
							<noesis:GamepadTrigger FiredOn="ButtonUp" Button="Accept">
								<b:InvokeCommandAction Command="{Binding DataContext.TakeCommand, ElementName=SelectBoonRewardPage}" />
							</noesis:GamepadTrigger>
						</noesis:StyleTriggerCollection>
					</Setter.Value>
				</Setter>
			</Style>
			
But that also doesn't work.

Re: Gamepad Trigger inside ListBox

Posted: 10 Feb 2026, 11:16
by ttermeer-reboundcg
Found the problem. It was unrelated to the XAML but an issue with Input Mapping priority and input consumption. We had set the input mapping for Noesis to -1 to not interfere with gameplay but the Input Action by default are set to consume the input for lower priority action. By unticking this option, gamepad is now properly working when poping UI elements during gameplay.

Re: Gamepad Trigger inside ListBox

Posted: 10 Feb 2026, 12:21
by hcpizzi
I'm glad you figured it out!