From 5e45ff5241546ce564eccefcc8b7fff876801415 Mon Sep 17 00:00:00 2001 From: Jim Raykowski Date: Thu, 11 Oct 2018 21:37:24 -0800 Subject: tdf#120534 Make escape key focus to document from sidebar from all locations other than panel content Change-Id: I85a113d3001338dd1aff27bac75a5debd4635d59 Reviewed-on: https://gerrit.libreoffice.org/62808 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- sfx2/source/sidebar/FocusManager.cxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'sfx2') diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx index 9645cb182f4d..610e28a4b66f 100644 --- a/sfx2/source/sidebar/FocusManager.cxx +++ b/sfx2/source/sidebar/FocusManager.cxx @@ -27,6 +27,8 @@ #include #include +#include + namespace sfx2 { namespace sidebar { FocusManager::FocusLocation::FocusLocation (const PanelComponent eComponent, const sal_Int32 nIndex) @@ -371,6 +373,26 @@ void FocusManager::HandleKeyEvent ( switch (rKeyCode.GetCode()) { + case KEY_ESCAPE: + switch (aLocation.meComponent) + { + case PC_TabBar: + case PC_DeckTitle: + case PC_DeckToolBox: + case PC_PanelTitle: + case PC_PanelToolBox: + { + vcl::Window* pFocusWin = Application::GetFocusWindow(); + if (pFocusWin) + pFocusWin->GrabFocusToDocument(); + break; + } + + default: + break; + } + return; + case KEY_SPACE: switch (aLocation.meComponent) { -- cgit