Added new option "Enable accelerators"

It will control whether keyboard accelerators are used in start menu.

Disabling it can be helpful for people that tend to hit some accelerator by mistake.

Fixes #447
This commit is contained in:
ge0rdi
2022-12-19 13:13:35 +01:00
parent fad20ba4c7
commit a7b6a80799
4 changed files with 12 additions and 1 deletions

View File

@@ -5115,6 +5115,9 @@ void CMenuContainer::UpdateSearchResults( bool bForceShowAll )
// Turn on the keyboard cues from now on. This is done when a keyboard action is detected
void CMenuContainer::ShowKeyboardCues( void )
{
if (!GetSettingBool(L"EnableAccelerators"))
return;
if (!s_bKeyboardCues)
{
s_bKeyboardCues=true;
@@ -6109,6 +6112,9 @@ LRESULT CMenuContainer::OnSysKeyDown( UINT uMsg, WPARAM wParam, LPARAM lParam, B
LRESULT CMenuContainer::OnChar( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled )
{
if (!GetSettingBool(L"EnableAccelerators"))
return TRUE;
if (wParam>=0xD800 && wParam<=0xDBFF)
return TRUE; // don't support supplementary characters
@@ -8070,7 +8076,7 @@ HWND CMenuContainer::ToggleStartMenu( int taskbarId, bool bKeyboard, bool bAllPr
s_bNoDragDrop=!GetSettingBool(L"EnableDragDrop");
s_bNoContextMenu=!GetSettingBool(L"EnableContextMenu");
s_bKeyboardCues=bKeyboard;
s_bKeyboardCues=bKeyboard&&GetSettingBool(L"EnableAccelerators");
s_RecentPrograms=(TRecentPrograms)GetSettingInt(L"RecentPrograms");
if (s_RecentPrograms!=RECENT_PROGRAMS_NONE)
LoadMRUShortcuts();

View File

@@ -4360,6 +4360,7 @@ CSetting g_Settings[]={
{L"DelayIcons",CSetting::TYPE_BOOL,IDS_DELAY_ICONS,IDS_DELAY_ICONS_TIP,1,CSetting::FLAG_COLD},
{L"BoldSettings",CSetting::TYPE_BOOL,IDS_BOLD_SETTINGS,IDS_BOLD_SETTINGS_TIP,1},
{L"ReportSkinErrors",CSetting::TYPE_BOOL,IDS_SKIN_ERRORS,IDS_SKIN_ERRORS_TIP,0},
{L"EnableAccelerators",CSetting::TYPE_BOOL,IDS_ENABLE_ACCELERATORS,IDS_ENABLE_ACCELERATORS_TIP,1},
{L"SearchBoxSettings",CSetting::TYPE_GROUP,IDS_SEARCH_BOX},
{L"SearchBox",CSetting::TYPE_INT,IDS_SHOW_SEARCH_BOX,IDS_SHOW_SEARCH_BOX_TIP,SEARCHBOX_TAB,CSetting::FLAG_BASIC},

View File

@@ -637,6 +637,8 @@ BEGIN
IDS_MENU_USERNAME "User name text"
IDS_MENU_USERNAME_TIP "Enter the text you want to see in the user-name portion of the menu (for skins that show the user name)"
IDS_PIC_COMMAND "User picture command"
IDS_ENABLE_ACCELERATORS "Enable accelerators"
IDS_ENABLE_ACCELERATORS_TIP "Use keyboard accelerators to execute menu commands"
END
STRINGTABLE

View File

@@ -780,6 +780,8 @@
#define IDS_OPEN_TRUE_PATH_TIP 3683
#define IDS_PINNED_PATH 3684
#define IDS_PINNED_PATH_TIP 3685
#define IDS_ENABLE_ACCELERATORS 3686
#define IDS_ENABLE_ACCELERATORS_TIP 3687
#define IDS_STRING7001 7001
#define IDS_STRING7002 7002
#define IDS_STRING7003 7003