Playing sound on GotFocus event - not ideal for gamepad controls
Hi, new to the forum and hoping the problem I'm experiencing is just an oversight on my behalf.
At the moment, I am using the GotFocus triggered event on menu items to play a sound as the user navigates around, just like the Noesis samples.
This works fine when the user is using gamepad inputs to navigate the screen. But upon a screen first loading up we set the focus to the first element - and this of course triggers the sound. But as the user did not navigate to the element themselves this sound is out of place and undesirable.
The sample project demos either don't focus an element upon a screen loading (mouse input only, this does not work for gamepad input), or they tie the element focus with a visual animation to give the sound some context - I am specifically referring to the Menu3D sample in this case - but our menus have the focused element already highlighted on load so the sound is not tied to anything and shouldn't be played.
Any feedback greatly appreciated, thanks.
At the moment, I am using the GotFocus triggered event on menu items to play a sound as the user navigates around, just like the Noesis samples.
This works fine when the user is using gamepad inputs to navigate the screen. But upon a screen first loading up we set the focus to the first element - and this of course triggers the sound. But as the user did not navigate to the element themselves this sound is out of place and undesirable.
The sample project demos either don't focus an element upon a screen loading (mouse input only, this does not work for gamepad input), or they tie the element focus with a visual animation to give the sound some context - I am specifically referring to the Menu3D sample in this case - but our menus have the focused element already highlighted on load so the sound is not tied to anything and shouldn't be played.
Any feedback greatly appreciated, thanks.
-
sfernandez
Site Admin
- Posts: 2983
- Joined:
Re: Playing sound on GotFocus event - not ideal for gamepad controls
Assuming you are setting the focus when screen gets loaded, you can disable the sound action during that initial focus:
Code: Select all
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<ei:ChangePropertyAction PropertyName="IsEnabled" Value="False" TargetName="FocusSound"/>
<noesis:SetFocusAction/>
<ei:ChangePropertyAction PropertyName="IsEnabled" Value="True" TargetName="FocusSound"/>
</i:EventTrigger>
<i:EventTrigger EventName="GotFocus">
<ei:PlaySoundAction x:Name="FocusSound" Source="Focus.mp3"/>
</i:EventTrigger>
</i:Interaction.Triggers>
Re: Playing sound on GotFocus event - not ideal for gamepad controls
That's great, thanks!
Who is online
Users browsing this forum: Google [Bot] and 66 guests