diff --git a/lcl/controls.pp b/lcl/controls.pp index 272ae2d79a..035458b5ec 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -70,6 +70,10 @@ const bvRaised = GraphType.bvRaised; bvSpace = GraphType.bvSpace; + // Constant to define which key should be utilized for keyboard shortcuts like Ctrl+C (Copy),Z,X,V + // Mac and iOS use Meta instead of Ctrl for those shortcuts + ssModifier = {$if defined(darwin) or defined(macos) or defined(iphonesim)} ssMeta {$else} ssCtrl {$endif}; + type TWinControl = class; TControl = class; diff --git a/lcl/maskedit.pp b/lcl/maskedit.pp index 309b5cb05a..74ae2fd98f 100644 --- a/lcl/maskedit.pp +++ b/lcl/maskedit.pp @@ -1657,7 +1657,7 @@ begin begin//Cut CutToClipBoard; end - else if (Shift = [ssCtrl]) then + else if (Shift = [ssModifier]) then begin//Clear DeleteSelected; end @@ -1701,20 +1701,20 @@ begin PasteFromClipBoard; end; end - else if (Shift = [ssCtrl]) then + else if (Shift = [ssModifier]) then begin//Copy CopyToClipBoard; end; Key := 0; Exit; end; - if (Key = VK_C) and (Shift = [ssCtrl]) then + if (Key = VK_C) and (Shift = [ssModifier]) then begin//Copy CopyToClipBoard; Key := 0; Exit; end; - if (Key = VK_X) and (Shift = [ssCtrl]) then + if (Key = VK_X) and (Shift = [ssModifier]) then begin//Cut if not ReadOnly then begin @@ -1723,7 +1723,7 @@ begin Exit; end; end; - if (Key = VK_V) and (Shift = [ssCtrl]) then + if (Key = VK_V) and (Shift = [ssModifier]) then begin//Paste if not ReadOnly then begin