mirror of
https://github.com/paleotronic/microm8-gui.git
synced 2024-06-08 01:29:34 +00:00
add defocus action delay of 250ms
This commit is contained in:
parent
b4a3c7e325
commit
06a8af05fe
|
@ -500,6 +500,7 @@ type
|
|||
lx, ly, lw, lh: integer;
|
||||
lastShowTime: TDateTime;
|
||||
lastHideTime: TDateTime;
|
||||
lastFocusLostTime: TDateTime;
|
||||
hidden: boolean;
|
||||
lastMouseX, lastMouseY: longint;
|
||||
inPopup: boolean;
|
||||
|
@ -539,7 +540,7 @@ var
|
|||
mstate: integer;
|
||||
s: string;
|
||||
begin
|
||||
s := GetConfig( baseUrl+'/api/control/mouse/buttonstate' );
|
||||
s := SimpleGet( baseUrl+'/api/control/mouse/buttonstate' );
|
||||
mstate := StrToInt( s );
|
||||
result := (mstate and integer(AMouseBtn)) <> 0;
|
||||
end;
|
||||
|
@ -560,7 +561,7 @@ function TGUIForm.IsMouseBtnDown: Boolean;
|
|||
var
|
||||
mstate: integer;
|
||||
begin
|
||||
mstate := StrToInt( GetConfig( baseUrl+'/api/control/mouse/buttonstate' ) );
|
||||
mstate := StrToInt( SimpleGet( baseUrl+'/api/control/mouse/buttonstate' ) );
|
||||
result := mstate <> 0;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
@ -2358,6 +2359,8 @@ end;
|
|||
|
||||
procedure TGUIForm.FormDeactivate(Sender: TObject);
|
||||
begin
|
||||
StatusBar1.SimpleText := 'focus lost';
|
||||
lastFocusLostTime:=Now();
|
||||
end;
|
||||
|
||||
procedure TGUIForm.FormHide(Sender: TObject);
|
||||
|
|
Binary file not shown.
Binary file not shown.
7
main.pas
7
main.pas
|
@ -500,6 +500,7 @@ type
|
|||
lx, ly, lw, lh: integer;
|
||||
lastShowTime: TDateTime;
|
||||
lastHideTime: TDateTime;
|
||||
lastFocusLostTime: TDateTime;
|
||||
hidden: boolean;
|
||||
lastMouseX, lastMouseY: longint;
|
||||
inPopup: boolean;
|
||||
|
@ -2289,8 +2290,8 @@ procedure TGUIForm.CheckTimerTimer(Sender: TObject);
|
|||
begin
|
||||
if isFS then
|
||||
exit;
|
||||
//if MilliSecondsBetween(Now(), lastShowTime) < 500 then
|
||||
// exit;
|
||||
if MilliSecondsBetween(Now(), lastFocusLostTime) < 250 then
|
||||
exit;
|
||||
if WindowState = wsMinimized then
|
||||
exit;
|
||||
//if hidden then
|
||||
|
@ -2358,6 +2359,8 @@ end;
|
|||
|
||||
procedure TGUIForm.FormDeactivate(Sender: TObject);
|
||||
begin
|
||||
StatusBar1.SimpleText := 'focus lost';
|
||||
lastFocusLostTime:=Now();
|
||||
end;
|
||||
|
||||
procedure TGUIForm.FormHide(Sender: TObject);
|
||||
|
|
Loading…
Reference in New Issue
Block a user