Page 1 of 1

GamepadTrigger to detect ▢△

Posted: 07 Feb 2025, 23:01
by alexk
Hello.
I'm trying to detect clicks on the right-side buttons of the PlayStation gamepad with GamepadTrigger. Here's my test code:
XAML:
<TextBox Text="{Binding ButtonPressed, FallbackValue=NoData}"
                         HorizontalAlignment="Center" VerticalAlignment="Center"
                         Background="Black" Foreground="Yellow"
                         FontSize="45"
                         Focusable="True"
                         FocusVisualStyle="{StaticResource MyFocusVisualStyle}"
                         >
                    <i:Interaction.Triggers>
                        <noesis:GamepadTrigger FiredOn="ButtonDown" Button="Up" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandUp}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonUp" Button="Up" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandRel}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonDown" Button="Down" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandDown}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonUp" Button="Down" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandRel}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonDown" Button="Left" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandLeft}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonUp" Button="Left" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandRel}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonDown" Button="Right" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandRight}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonUp" Button="Right" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandRel}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonDown" Button="Context1" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandCtx1}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonUp" Button="Context1" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandRel}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonDown" Button="Context2" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandCtx2}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonUp" Button="Context2" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandRel}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonDown" Button="Context3" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandCtx3}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonUp" Button="Context3" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandRel}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonDown" Button="Context4" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandCtx4}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonUp" Button="Context4" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandRel}"/>
                        </noesis:GamepadTrigger>
                         <noesis:GamepadTrigger FiredOn="ButtonDown" Button="Menu" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandMenu}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonUp" Button="Menu" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandRel}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonDown" Button="View" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandView}"/>
                        </noesis:GamepadTrigger>
                        <noesis:GamepadTrigger FiredOn="ButtonUp" Button="View" ActiveOnFocus="False">
                            <i:InvokeCommandAction Command="{Binding TestButtonCommandRel}"/>
                        </noesis:GamepadTrigger>

                    </i:Interaction.Triggers>
                </TextBox>
Then I hook up all of those "TestButtonCommand<X>" commands in the viewmodel to change the ButtonPressed value.
I'm getting expected results for Button="Left", "Right", "Up", and "Down" (also X and O on "Accept" and "Cancel" not shown here), but no reaction at all on ▢ and △ clicks. What am I doing wrong here?

Re: GamepadTrigger to detect ▢△

Posted: 11 Feb 2025, 14:23
by jsantos
Hello!

Unfortunately, the following actions are not available as Actions that can be mapped in the Unity VIew:
  • GamepadContext1
  • GamepadContext2
  • GamepadContext3
  • GamepadContext4
Could you please create at ticket for this? I will provide a hot-fix.

Re: GamepadTrigger to detect ▢△

Posted: 17 Feb 2025, 03:56
by alexk

Re: GamepadTrigger to detect ▢△

Posted: 18 Feb 2025, 18:18
by jsantos
Thanks!