From 1acbccaa74d12bdc241d3ccc69606d84274dc553 Mon Sep 17 00:00:00 2001 From: Bastian Schmidt Date: Sat, 6 Feb 2016 09:58:15 +0100 Subject: [PATCH] Terminating keytips on unknown keys/keyboard navigation request #258 --- Fluent.Ribbon/Services/KeyTipService.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Fluent.Ribbon/Services/KeyTipService.cs b/Fluent.Ribbon/Services/KeyTipService.cs index 60d3e1cde..d175c8b06 100644 --- a/Fluent.Ribbon/Services/KeyTipService.cs +++ b/Fluent.Ribbon/Services/KeyTipService.cs @@ -229,6 +229,14 @@ private void OnWindowPreviewKeyDown(object sender, KeyEventArgs e) // Don't do anything and let WPF handle the rest if (isKeyRealInput == false) { + // This block is a "temporary" fix for keyboard navigation not matching the office behavior. + // If someone finds a way to implement it properly, here is your starting point. + // In office: If you navigate by keyboard (in menus) and keytips are shown they are shown or hidden based on the menu you are in. + // Implementing navigation the way office does would require complex focus/state tracking etc. so i decided to just terminate keytips and not restore focus. + { + this.backUpFocusedControl = null; + this.activeAdornerChain?.Terminate(); + } return; }