Skip to content

Commit 1a9fb98

Browse files
author
Wouter Spaas
committed
Remember Focus State before triggering button on Voice Command. Reset state after triggering.
1 parent 5a82135 commit 1a9fb98

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Assets/MRTK/SDK/Features/UX/Interactable/Scripts/Interactable.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,11 +1513,13 @@ public void OnSpeechKeywordRecognized(SpeechEventData eventData)
15131513

15141514
if (eventData.Command.Keyword == VoiceCommand && (!VoiceRequiresFocus || HasFocus) && CanInteract())
15151515
{
1516+
bool hadFocus = HasFocus;
15161517
StartGlobalVisual(true);
15171518
HasVoiceCommand = true;
15181519
SendVoiceCommands(VoiceCommand, 0, 1);
15191520
TriggerOnClick();
15201521
eventData.Use();
1522+
HasFocus = hadFocus;
15211523
}
15221524
}
15231525

0 commit comments

Comments
 (0)