diff options
author | Abhilash Singh <abhilash300singh@gmail.com> | 2016-12-07 10:26:10 +0530 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-08 09:11:50 +0000 |
commit | 64889c9fb6c3e8e7b7a7349833f7a10236104168 (patch) | |
tree | aba034460bf00236d0dc3f31880c74228b18d97e /vcl/win/gdi | |
parent | 663e5a54386d8bdee4ebc2bdd6f93da8a6f99ebe (diff) |
tdf#54169 Don't show acclerators by default on Windows
Change-Id: I2bdecae83ed23e4f6fff0be99b46005a6db43837
Reviewed-on: https://gerrit.libreoffice.org/31711
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/win/gdi')
-rw-r--r-- | vcl/win/gdi/salnativewidgets-luna.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx index 23fa61ad9725..bb053c616611 100644 --- a/vcl/win/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/gdi/salnativewidgets-luna.cxx @@ -188,6 +188,31 @@ BOOL VisualStylesAPI::IsThemeActive() void SalData::initNWF() { ImplSVData* pSVData = ImplGetSVData(); + pSVData->maNWFData.mbEnableAccel = false; // Don't show accelerators all the time + pSVData->maNWFData.mbAutoAccel = true; // Show accelerators only when alt is pressed + + HKEY hkey; + + if (ERROR_SUCCESS == RegOpenKey(HKEY_CURRENT_USER, "Control Panel\\Accessibility\\Keyboard Preference", &hkey)) + { + DWORD dwType = 0; + sal_uInt8 Data[2]; // possible values: "1", "0" + DWORD cbData = sizeof(Data); + + if (ERROR_SUCCESS == RegQueryValueEx(hkey, "On", nullptr, &dwType, Data, &cbData)) // Check whether "make keyboard easier to use" is turned on + { + if (dwType == REG_SZ) + { + bool bValue = ((0 == stricmp(reinterpret_cast<const char *>(Data), "1"))); + if(bValue) + { + pSVData->maNWFData.mbEnableAccel = true; // Always show accelerators + pSVData->maNWFData.mbAutoAccel = false; + } + } + } + RegCloseKey(hkey); + } // the menu bar and the top docking area should have a common background (gradient) pSVData->maNWFData.mbMenuBarDockingAreaCommonBG = true; |