Skip to content

Commit 239fb87

Browse files
committed
Update accelerator text generation for Ctrl+-/Ctrl++
This is part of the work for issue #476.
1 parent c6ddf55 commit 239fb87

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Explorer++/Helper/Helper.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,9 @@ bool IsExtendedKey(UINT key)
785785
|| key == VK_INSERT
786786
|| key == VK_DELETE
787787
|| key == VK_DIVIDE
788-
|| key == VK_NUMLOCK)
788+
|| key == VK_NUMLOCK
789+
|| key == VK_ADD
790+
|| key == VK_SUBTRACT)
789791
// clang-format on
790792
{
791793
return true;

Explorer++/TestExplorer++/AcceleratorHelperTest.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@ TEST(AcceleratorHelperTest, BuildAcceleratorString)
2828
accelerator.key = 'P';
2929
acceleratorText = BuildAcceleratorString(accelerator);
3030
EXPECT_EQ(acceleratorText, L"Ctrl+Shift+P");
31+
32+
// This should generate the string "Ctrl++" (and not something like "Ctrl+Num +").
33+
accelerator = {};
34+
accelerator.fVirt = FVIRTKEY | FCONTROL;
35+
accelerator.key = VK_ADD;
36+
acceleratorText = BuildAcceleratorString(accelerator);
37+
EXPECT_EQ(acceleratorText, L"Ctrl++");
38+
39+
// And this should be "Ctrl+-" (not "Ctrl+Num -").
40+
accelerator = {};
41+
accelerator.fVirt = FVIRTKEY | FCONTROL;
42+
accelerator.key = VK_SUBTRACT;
43+
acceleratorText = BuildAcceleratorString(accelerator);
44+
EXPECT_EQ(acceleratorText, L"Ctrl+-");
3145
}
3246

3347
TEST(AcceleratorHelperTest, AcceleratorTableConversion)

0 commit comments

Comments
 (0)