diff --git a/src/NotifyIconWpf/TaskbarIcon.cs b/src/NotifyIconWpf/TaskbarIcon.cs index 8d7cf4b..d10a3d9 100644 --- a/src/NotifyIconWpf/TaskbarIcon.cs +++ b/src/NotifyIconWpf/TaskbarIcon.cs @@ -1,4 +1,4 @@ -// hardcodet.net NotifyIcon for WPF +// hardcodet.net NotifyIcon for WPF // Copyright (c) 2009 - 2022 Philipp Sumi. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // Contact and Information: http://www.hardcodet.net @@ -783,6 +783,9 @@ private void ShowContextMenu(Point cursorPosition) // fallback, the context menu can't receive keyboard events - should not happen though WinApi.SetForegroundWindow(handle); + // set also the focus to the context menu, so that the keyboard works (using ESC if mouse is not over context menu). + ContextMenu.Focus(); + // bubble event RaiseTrayContextMenuOpenEvent(); }