- lowprofile
- Posts: 4
- Joined:
What is the best way to use Unreal Engine Input Actions in Xamls?
Is there a way to use Input Actions in xamls? As I see raw input events are mapped into noesis keys. But I am not sure how about Input Actions. I am planning to solve it by myself, but I wanted to be sure if there is a suggested way to do it.
Re: What is the best way to use Unreal Engine Input Actions in Xamls?
Hi,
Could you tell us a bit about how you would use them?
Thank you
Could you tell us a bit about how you would use them?
Thank you
Re: What is the best way to use Unreal Engine Input Actions in Xamls?
In our Unity plugin, the gamepad is configured using input actions. It allows you to define, for example, the different gamepad actions to invoke Up, Down, Left, Right, Accept, Cancel and so on.
But Unreal, already provides a high-level view of gamepad events (like EKeys::Gamepad_FaceButton_Bottom) so we didn't need using something similar to Unity input actions definitions.
Please, let us understand your scenario a bit better.
But Unreal, already provides a high-level view of gamepad events (like EKeys::Gamepad_FaceButton_Bottom) so we didn't need using something similar to Unity input actions definitions.
Please, let us understand your scenario a bit better.
- lowprofile
- Posts: 4
- Joined:
Re: What is the best way to use Unreal Engine Input Actions in Xamls?
Imagine I have "Back" action defined in UE ActionsMappings that is triggered with "Escape" and "Gamepad Face Button Right" keys
and in a xaml I have a button similar to this one
As you see I want to just specify the InputAction here.
Depending on the solution when this action is triggered in UE, I could trigger Click even on this button. Or I could create a custom InputActionEvent in Noesis, so I could deal with the event manually in the xaml using interaction framework (eg. EventTrigger)
As I understand in the current system, I need to listen both "Escape" and "Game pad face button right" events manually in the xaml, right? (by using their Noesis key names)
and in a xaml I have a button similar to this one
Code: Select all
<Button Content="Back" Margin="10" Height="Auto" InputAction="Back" Command="{Binding BackCommand}"/>
Depending on the solution when this action is triggered in UE, I could trigger Click even on this button. Or I could create a custom InputActionEvent in Noesis, so I could deal with the event manually in the xaml using interaction framework (eg. EventTrigger)
As I understand in the current system, I need to listen both "Escape" and "Game pad face button right" events manually in the xaml, right? (by using their Noesis key names)
-
sfernandez
Site Admin
- Posts: 2997
- Joined:
Re: What is the best way to use Unreal Engine Input Actions in Xamls?
So if we got this right what you want is instead of having to write something like this in the xaml
Specify a trigger for an Unreal's input action instead:
We can implement an extension like that in Unreal if it is what you require.
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions">
<b:Interaction.Triggers>
<b:KeyTrigger Key="Escape">
<b:InvokeCommandAction Command="{Biding BackCommand}"/>
</b:KeyTrigger>
<noesis:GamepadTrigger Button="Left">
<b:InvokeCommandAction Command="{Biding BackCommand}"/>
</noesis:GamepadTrigger>
</b:Interaction.Triggers>
<Button Content="BACK" Command="{Binding BackCommand}"/>
</Grid>
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions">
<b:Interaction.Triggers>
<noesis:InputActionTrigger Action="Back">
<b:InvokeCommandAction Command="{Biding BackCommand}"/>
</noesis:InputActionTrigger>
</b:Interaction.Triggers>
<Button Content="BACK" Command="{Binding BackCommand}"/>
</Grid>
- lowprofile
- Posts: 4
- Joined:
Re: What is the best way to use Unreal Engine Input Actions in Xamls?
This is a great solution. I believe it would be nice to have it as part of the extension
Would it be possible to have it like this?
This way:
- We do not need to specify Command two times.
- When Back button disabled, the ActionTrigger is also disabled
If you can, could you also make the KeyboardNavigation work with InputActions instead of hardcoded input keys. Because we would like to be able to use W,S,A,D to navigate in menus. But we can't do it now. I believe all these changes would also allow us to have Input Settings panel where player could change key-bindings easily. Because all UI would depend on InputActions instead of hardcoded InputKeys
Would it be possible to have it like this?
This way:
- We do not need to specify Command two times.
- When Back button disabled, the ActionTrigger is also disabled
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions">
<Button Content="BACK">
<b:Interaction.Triggers>
<noesis:InputActionTrigger Action="Back">
<b:InvokeCommandAction Command="{Biding BackCommand}"/>
</noesis:InputActionTrigger>
</b:Interaction.Triggers>
</Button>
</Grid>
- lowprofile
- Posts: 4
- Joined:
Re: What is the best way to use Unreal Engine Input Actions in Xamls?
or can we do it like this?
Code: Select all
<Button Content="Back" Margin="10" Height="Auto" common:InputActionProperty.Action="Back" Command="{Binding BackCommand}"/>
-
sfernandez
Site Admin
- Posts: 2997
- Joined:
Re: What is the best way to use Unreal Engine Input Actions in Xamls?
Hi,
I think your idea of using an attached property in combination with a Button is very practical and easy to use. We can implement that, but I think it will be also very useful to have the InputAction as a trigger so it can be used to invoke different type of actions, not only executing a command. Can you please ask for this feature in our bugtracker and we will implement both approaches?
I think your idea of using an attached property in combination with a Button is very practical and easy to use. We can implement that, but I think it will be also very useful to have the InputAction as a trigger so it can be used to invoke different type of actions, not only executing a command. Can you please ask for this feature in our bugtracker and we will implement both approaches?
Re: What is the best way to use Unreal Engine Input Actions in Xamls?
Yes, this is exactly what we are doing in Unity for the gamepad. We should do the same in Unreal. Please, file a ticket about this too.If you can, could you also make the KeyboardNavigation work with InputActions instead of hardcoded input keys. Because we would like to be able to use W,S,A,D to navigate in menus. But we can't do it now. I believe all these changes would also allow us to have Input Settings panel where player could change key-bindings easily. Because all UI would depend on InputActions instead of hardcoded InputKeys
Who is online
Users browsing this forum: No registered users and 12 guests