mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 10:16:56 +02:00
Patch from bug #20121, also added ssModifier constant in the unit Controls for global usage, but use it with care not to do something like [ssModifier, ssMeta] which wont compile in Macs
git-svn-id: trunk@35131 -
This commit is contained in:
parent
3b95059ce4
commit
1130c0fb47
@ -70,6 +70,10 @@ const
|
|||||||
bvRaised = GraphType.bvRaised;
|
bvRaised = GraphType.bvRaised;
|
||||||
bvSpace = GraphType.bvSpace;
|
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
|
type
|
||||||
TWinControl = class;
|
TWinControl = class;
|
||||||
TControl = class;
|
TControl = class;
|
||||||
|
@ -1657,7 +1657,7 @@ begin
|
|||||||
begin//Cut
|
begin//Cut
|
||||||
CutToClipBoard;
|
CutToClipBoard;
|
||||||
end
|
end
|
||||||
else if (Shift = [ssCtrl]) then
|
else if (Shift = [ssModifier]) then
|
||||||
begin//Clear
|
begin//Clear
|
||||||
DeleteSelected;
|
DeleteSelected;
|
||||||
end
|
end
|
||||||
@ -1701,20 +1701,20 @@ begin
|
|||||||
PasteFromClipBoard;
|
PasteFromClipBoard;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else if (Shift = [ssCtrl]) then
|
else if (Shift = [ssModifier]) then
|
||||||
begin//Copy
|
begin//Copy
|
||||||
CopyToClipBoard;
|
CopyToClipBoard;
|
||||||
end;
|
end;
|
||||||
Key := 0;
|
Key := 0;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
if (Key = VK_C) and (Shift = [ssCtrl]) then
|
if (Key = VK_C) and (Shift = [ssModifier]) then
|
||||||
begin//Copy
|
begin//Copy
|
||||||
CopyToClipBoard;
|
CopyToClipBoard;
|
||||||
Key := 0;
|
Key := 0;
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
if (Key = VK_X) and (Shift = [ssCtrl]) then
|
if (Key = VK_X) and (Shift = [ssModifier]) then
|
||||||
begin//Cut
|
begin//Cut
|
||||||
if not ReadOnly then
|
if not ReadOnly then
|
||||||
begin
|
begin
|
||||||
@ -1723,7 +1723,7 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if (Key = VK_V) and (Shift = [ssCtrl]) then
|
if (Key = VK_V) and (Shift = [ssModifier]) then
|
||||||
begin//Paste
|
begin//Paste
|
||||||
if not ReadOnly then
|
if not ReadOnly then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user