Skip to content

Commit a7b6a80

Browse files
committed
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
1 parent fad20ba commit a7b6a80

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

Src/StartMenu/StartMenuDLL/MenuContainer.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5115,6 +5115,9 @@ void CMenuContainer::UpdateSearchResults( bool bForceShowAll )
51155115
// Turn on the keyboard cues from now on. This is done when a keyboard action is detected
51165116
void CMenuContainer::ShowKeyboardCues( void )
51175117
{
5118+
if (!GetSettingBool(L"EnableAccelerators"))
5119+
return;
5120+
51185121
if (!s_bKeyboardCues)
51195122
{
51205123
s_bKeyboardCues=true;
@@ -6109,6 +6112,9 @@ LRESULT CMenuContainer::OnSysKeyDown( UINT uMsg, WPARAM wParam, LPARAM lParam, B
61096112

61106113
LRESULT CMenuContainer::OnChar( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled )
61116114
{
6115+
if (!GetSettingBool(L"EnableAccelerators"))
6116+
return TRUE;
6117+
61126118
if (wParam>=0xD800 && wParam<=0xDBFF)
61136119
return TRUE; // don't support supplementary characters
61146120

@@ -8070,7 +8076,7 @@ HWND CMenuContainer::ToggleStartMenu( int taskbarId, bool bKeyboard, bool bAllPr
80708076

80718077
s_bNoDragDrop=!GetSettingBool(L"EnableDragDrop");
80728078
s_bNoContextMenu=!GetSettingBool(L"EnableContextMenu");
8073-
s_bKeyboardCues=bKeyboard;
8079+
s_bKeyboardCues=bKeyboard&&GetSettingBool(L"EnableAccelerators");
80748080
s_RecentPrograms=(TRecentPrograms)GetSettingInt(L"RecentPrograms");
80758081
if (s_RecentPrograms!=RECENT_PROGRAMS_NONE)
80768082
LoadMRUShortcuts();

Src/StartMenu/StartMenuDLL/SettingsUI.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4360,6 +4360,7 @@ CSetting g_Settings[]={
43604360
{L"DelayIcons",CSetting::TYPE_BOOL,IDS_DELAY_ICONS,IDS_DELAY_ICONS_TIP,1,CSetting::FLAG_COLD},
43614361
{L"BoldSettings",CSetting::TYPE_BOOL,IDS_BOLD_SETTINGS,IDS_BOLD_SETTINGS_TIP,1},
43624362
{L"ReportSkinErrors",CSetting::TYPE_BOOL,IDS_SKIN_ERRORS,IDS_SKIN_ERRORS_TIP,0},
4363+
{L"EnableAccelerators",CSetting::TYPE_BOOL,IDS_ENABLE_ACCELERATORS,IDS_ENABLE_ACCELERATORS_TIP,1},
43634364

43644365
{L"SearchBoxSettings",CSetting::TYPE_GROUP,IDS_SEARCH_BOX},
43654366
{L"SearchBox",CSetting::TYPE_INT,IDS_SHOW_SEARCH_BOX,IDS_SHOW_SEARCH_BOX_TIP,SEARCHBOX_TAB,CSetting::FLAG_BASIC},

Src/StartMenu/StartMenuDLL/StartMenuDLL.rc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,8 @@ BEGIN
637637
IDS_MENU_USERNAME "User name text"
638638
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)"
639639
IDS_PIC_COMMAND "User picture command"
640+
IDS_ENABLE_ACCELERATORS "Enable accelerators"
641+
IDS_ENABLE_ACCELERATORS_TIP "Use keyboard accelerators to execute menu commands"
640642
END
641643

642644
STRINGTABLE

Src/StartMenu/StartMenuDLL/resource.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,8 @@
780780
#define IDS_OPEN_TRUE_PATH_TIP 3683
781781
#define IDS_PINNED_PATH 3684
782782
#define IDS_PINNED_PATH_TIP 3685
783+
#define IDS_ENABLE_ACCELERATORS 3686
784+
#define IDS_ENABLE_ACCELERATORS_TIP 3687
783785
#define IDS_STRING7001 7001
784786
#define IDS_STRING7002 7002
785787
#define IDS_STRING7003 7003

0 commit comments

Comments
 (0)