User avatar
ttermeer-reboundcg
Topic Author
Posts: 31
Joined: 13 Sep 2019, 11:10
Contact:

Gamepad Trigger inside ListBox

09 Feb 2026, 18:18

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>
 
User avatar
hcpizzi
Site Admin
Posts: 368
Joined: 09 Feb 2012, 12:40

Re: Gamepad Trigger inside ListBox

09 Feb 2026, 21:01

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!
 
User avatar
ttermeer-reboundcg
Topic Author
Posts: 31
Joined: 13 Sep 2019, 11:10
Contact:

Re: Gamepad Trigger inside ListBox

10 Feb 2026, 00:01

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.
 
User avatar
ttermeer-reboundcg
Topic Author
Posts: 31
Joined: 13 Sep 2019, 11:10
Contact:

Re: Gamepad Trigger inside ListBox

10 Feb 2026, 10:11

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.
 
User avatar
ttermeer-reboundcg
Topic Author
Posts: 31
Joined: 13 Sep 2019, 11:10
Contact:

Re: Gamepad Trigger inside ListBox

10 Feb 2026, 11:16

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.
 
User avatar
hcpizzi
Site Admin
Posts: 368
Joined: 09 Feb 2012, 12:40

Re: Gamepad Trigger inside ListBox

10 Feb 2026, 12:21

I'm glad you figured it out!

Who is online

Users browsing this forum: Bing [Bot] and 3 guests