Click and Mouse Up delayed events

- To test whether the click at 1:1 works or not. Mouse UP should be done before moving back
This commit is contained in:
Steve Jordi 2026-09-29 20:22:35 +02:00
commit f321a6ebea
3 changed files with 46 additions and 44 deletions

View file

@ -1,44 +1,44 @@
object frmMain: TfrmMain
Left = 0
Top = 0
Caption = 'Battery Monitor'
ClientHeight = 63
ClientWidth = 292
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Segoe UI'
Font.Style = []
OnCreate = FormCreate
TextHeight = 15
object lblStatus: TLabel
Left = 181
Top = 13
Width = 100
Height = 15
AutoSize = False
end
object btnStart: TButton
Left = 8
Top = 8
Width = 113
Height = 25
Caption = 'Start Monitor'
TabOrder = 0
OnClick = btnStartClick
end
object progressBar: TProgressBar
Left = 8
Top = 39
Width = 273
Height = 17
Enabled = False
Position = 87
MarqueeInterval = 0
BarColor = clLime
Step = 1
State = pbsPaused
TabOrder = 1
end
end
object frmMain: TfrmMain
Left = 0
Top = 0
Caption = 'Battery Monitor'
ClientHeight = 63
ClientWidth = 292
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Segoe UI'
Font.Style = []
OnCreate = FormCreate
TextHeight = 15
object lblStatus: TLabel
Left = 181
Top = 13
Width = 100
Height = 15
AutoSize = False
end
object btnStart: TButton
Left = 8
Top = 8
Width = 113
Height = 25
Caption = 'Start Monitor'
TabOrder = 0
OnClick = btnStartClick
end
object progressBar: TProgressBar
Left = 8
Top = 39
Width = 273
Height = 17
Enabled = False
Position = 87
MarqueeInterval = 0
BarColor = clLime
Step = 1
State = pbsPaused
TabOrder = 1
end
end

View file

@ -97,6 +97,8 @@ begin
// Simulate mouse button press and release
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 1, 1, 0);
Sleep(150);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 1, 1, 0);
Sleep(50);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 1, 1, 0);
// Get back to position
mouse.CursorPos := currentPos ;