Browse Source

Insert and Ctrl+Space selections were not included in the KeyboardSelections counter

(cherry picked from commit 4ff1107f8424d7212bb3a5ebce7e00c274c38e1f)

Source commit: 72d0dc47ad5e688f17fb0f77b4aab59d23d330d6
Martin Prikryl 9 năm trước cách đây
mục cha
commit
157579e97d
1 tập tin đã thay đổi với 14 bổ sung2 xóa
  1. 14 2
      source/packages/my/NortonLikeListView.pas

+ 14 - 2
source/packages/my/NortonLikeListView.pas

@@ -467,7 +467,13 @@ begin
   begin
     if Items.Count > 0 then
     begin
-      SelectCurrentItem(True);
+      PLastSelectMethod := FLastSelectMethod;
+      FLastSelectMethod := smKeyboard;
+      try
+        SelectCurrentItem(True);
+      finally
+        FLastSelectMethod := PLastSelectMethod;
+      end;
       Message.Result := 1;
     end;
   end
@@ -511,7 +517,13 @@ begin
     // prevent Ctrl+Space landing in else branch below,
     // this can safely get processed by default handler as Ctrl+Space
     // toggles only focused item, not affecting others
-    inherited;
+    PLastSelectMethod := FLastSelectMethod;
+    FLastSelectMethod := smKeyboard;
+    try
+      inherited;
+    finally
+      FLastSelectMethod := PLastSelectMethod;
+    end;
   end
     else
   if (Message.CharCode in [VK_SPACE, VK_PRIOR, VK_NEXT, VK_END, VK_HOME, VK_LEFT,