瀏覽代碼

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

Source commit: a62461753e3c05211c96652679c8e8f3adec2a50
Martin Prikryl 9 年之前
父節點
當前提交
4ff1107f84
共有 1 個文件被更改,包括 14 次插入2 次删除
  1. 14 2
      source/packages/my/NortonLikeListView.pas

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

@@ -482,7 +482,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
@@ -526,7 +532,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,