Skip to content

Commit

Permalink
Dyn 5444 splash screen keyboard (#13959)
Browse files Browse the repository at this point in the history
* Focus and get the Enter key ready

* spacing

* Closing on Esc key press
  • Loading branch information
jesusalvino authored May 4, 2023
1 parent 6f663a3 commit 6f7f2bb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Input;
using System.Xml.Serialization;
using Dynamo.Configuration;
using Dynamo.Controls;
Expand Down Expand Up @@ -144,8 +145,17 @@ private void WebView_NavigationCompleted(object sender, CoreWebView2NavigationCo
webView.NavigationCompleted -= WebView_NavigationCompleted;
}
OnRequestDynamicSplashScreen();

this.webView.Focus();
System.Windows.Forms.SendKeys.SendWait("{TAB}");
webView.KeyDown += WebView_KeyDown;
}

private void WebView_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
if (e.Key == Key.Escape)
CloseWindow();
}
/// <summary>
/// Request to close SplashScreen.
/// </summary>
Expand Down Expand Up @@ -472,6 +482,7 @@ protected override void OnClosed(EventArgs e)
base.OnClosed(e);

DynamoModel.RequestUpdateLoadBarStatus -= DynamoModel_RequestUpdateLoadBarStatus;
webView.KeyDown -= WebView_KeyDown;
webView.Dispose();
webView = null;

Expand Down

0 comments on commit 6f7f2bb

Please sign in to comment.