|
@@ -1115,63 +1115,45 @@ function TGenericTool.ToolKeyDown(var key: Word): TRect;
|
|
var
|
|
var
|
|
key2: Word;
|
|
key2: Word;
|
|
begin
|
|
begin
|
|
- if (Key = VK_SNAP) or (Key = VK_SNAP2) then
|
|
|
|
- begin
|
|
|
|
- key2 := VK_CONTROL;
|
|
|
|
- result := DoToolKeyDown(key2);
|
|
|
|
- if key2 = 0 then key := 0;
|
|
|
|
- end else
|
|
|
|
- result := DoToolKeyDown(key);
|
|
|
|
-
|
|
|
|
if key = VK_SHIFT then
|
|
if key = VK_SHIFT then
|
|
begin
|
|
begin
|
|
Include(FShiftState, ssShift);
|
|
Include(FShiftState, ssShift);
|
|
- key := 0;
|
|
|
|
|
|
+ //do not reset Key to preserve typing ^o or "o
|
|
end else
|
|
end else
|
|
|
|
+ if (key = VK_MENU) then
|
|
|
|
+ Include(FShiftState, ssAlt);
|
|
|
|
+
|
|
if (Key = VK_SNAP) or (Key = VK_SNAP2) then
|
|
if (Key = VK_SNAP) or (Key = VK_SNAP2) then
|
|
begin
|
|
begin
|
|
|
|
+ key2 := VK_CONTROL;
|
|
Include(FShiftState, ssSnap);
|
|
Include(FShiftState, ssSnap);
|
|
- key := 0;
|
|
|
|
|
|
+ result := DoToolKeyDown(key2);
|
|
|
|
+ if key2 = 0 then key := 0;
|
|
end else
|
|
end else
|
|
- if (key = VK_MENU) then
|
|
|
|
- begin
|
|
|
|
- Include(FShiftState, ssAlt);
|
|
|
|
- key := 0;
|
|
|
|
- end;
|
|
|
|
|
|
+ result := DoToolKeyDown(key);
|
|
end;
|
|
end;
|
|
|
|
|
|
function TGenericTool.ToolKeyUp(var key: Word): TRect;
|
|
function TGenericTool.ToolKeyUp(var key: Word): TRect;
|
|
var
|
|
var
|
|
- handled: Boolean;
|
|
|
|
key2: word;
|
|
key2: word;
|
|
begin
|
|
begin
|
|
if (key = VK_SHIFT) and (ssShift in FShiftState) then
|
|
if (key = VK_SHIFT) and (ssShift in FShiftState) then
|
|
begin
|
|
begin
|
|
Exclude(FShiftState, ssShift);
|
|
Exclude(FShiftState, ssShift);
|
|
- handled := true;
|
|
|
|
- end else
|
|
|
|
- if ((key = VK_SNAP) or (key = VK_SNAP2)) and (ssSnap in FShiftState) then
|
|
|
|
- begin
|
|
|
|
- Exclude(FShiftState, ssSnap);
|
|
|
|
- handled := true;
|
|
|
|
|
|
+ //do not reset key to preserve typing ^o or "o
|
|
end else
|
|
end else
|
|
if (key = VK_MENU) and (ssAlt in FShiftState) then
|
|
if (key = VK_MENU) and (ssAlt in FShiftState) then
|
|
- begin
|
|
|
|
Exclude(FShiftState, ssAlt);
|
|
Exclude(FShiftState, ssAlt);
|
|
- handled := true;
|
|
|
|
- end else
|
|
|
|
- handled := false;
|
|
|
|
|
|
|
|
//propagate in all cases to know when keys are released for unicode input
|
|
//propagate in all cases to know when keys are released for unicode input
|
|
if (Key = VK_SNAP) or (Key = VK_SNAP2) then
|
|
if (Key = VK_SNAP) or (Key = VK_SNAP2) then
|
|
begin
|
|
begin
|
|
key2 := VK_CONTROL;
|
|
key2 := VK_CONTROL;
|
|
|
|
+ Exclude(FShiftState, ssSnap);
|
|
result := DoToolKeyUp(key2);
|
|
result := DoToolKeyUp(key2);
|
|
if key2 = 0 then key := 0;
|
|
if key2 = 0 then key := 0;
|
|
end else
|
|
end else
|
|
result := DoToolKeyUp(key);
|
|
result := DoToolKeyUp(key);
|
|
-
|
|
|
|
- if handled then key := 0;
|
|
|
|
end;
|
|
end;
|
|
|
|
|
|
function TGenericTool.ToolKeyPress(var key: TUTF8Char): TRect;
|
|
function TGenericTool.ToolKeyPress(var key: TUTF8Char): TRect;
|