From 7c7507e9319e65f7e9a16cbb66ffdea859403d19 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Mon, 8 Jan 2024 13:58:03 +0100 Subject: tdf#157649 Allow omitting Alt key in Windows only Follow-up for ea1421747985bd09ad40565da8536e857b5c2e9a Change-Id: Ifdfeb8a0a9507f66af26607efc31438169452b46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161787 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- vcl/source/window/dlgctrl.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vcl') diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index 90cdf353f8c0..ac75333d9011 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -952,9 +952,13 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) GetFocusFlags nGetFocusFlags = GetFocusFlags::Mnemonic; if ( pSWindow == ::ImplFindAccelWindow( this, i, c, nFormStart, nFormEnd ) ) nGetFocusFlags |= GetFocusFlags::UniqueMnemonic; +#ifdef _WIN32 // tdf#157649 Allow omitting the Alt key when focus is in the dialog action area: bool bIsButtonBox = dynamic_cast(pSWindow->GetParent()) != nullptr; if ((bIsButtonBox && pSWindow->GetParent()->HasChildPathFocus(true)) || aKeyCode.IsMod2()) +#else + if (aKeyCode.IsMod2()) +#endif { pSWindow->ImplControlFocus( nGetFocusFlags ); return true; -- cgit