Initial Commit

This commit is contained in:
Steve Jordi 2026-09-29 12:23:31 +02:00
commit fc8d3767ba
7 changed files with 1422 additions and 75 deletions

148
.gitignore vendored
View file

@ -1,84 +1,72 @@
# ---> Delphi
# Uncomment these types if you want even more clean repository. But be careful.
# It can make harm to an existing project source. Read explanations below.
#
# Resource files are binaries containing manifest, project icon and version info.
# They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files.
#*.res
#
# Type library file (binary). In old Delphi versions it should be stored.
# Since Delphi 2009 it is produced from .ridl file and can safely be ignored.
#*.tlb
#
# Diagram Portfolio file. Used by the diagram editor up to Delphi 7.
# Uncomment this if you are not using diagrams or use newer Delphi version.
#*.ddp
#
# Visual LiveBindings file. Added in Delphi XE2.
# Uncomment this if you are not using LiveBindings Designer.
#*.vlb
#
# Deployment Manager configuration file for your project. Added in Delphi XE2.
# Uncomment this if it is not mobile development and you do not use remote debug feature.
#*.deployproj
#
# C++ object files produced when C/C++ Output file generation is configured.
# Uncomment this if you are not using external objects (zlib library for example).
#*.obj
#
# Default Delphi compiler directories
# Content of this directories are generated with each Compile/Construct of a project.
# Most of the time, files here have not there place in a code repository.
#Win32/
#Win64/
#OSX64/
#OSXARM64/
#Android/
#Android64/
#iOSDevice64/
#Linux64/
# Delphi compiler-generated binaries (safe to delete)
*.exe
*.dll
*.bpl
*.bpi
*.dcp
*.so
*.apk
*.drc
*.map
*.dres
*.rsm
*.tds
*.dcu
*.lib
*.a
*.o
*.ocx
# Delphi autogenerated files (duplicated info)
*.cfg
*.hpp
*Resource.rc
# Delphi local files (user-specific info)
*.local
*.identcache
*.projdata
*.tvsconfig
*.dsk
*.dsv
# Delphi history and backups
__history/
__recovery/
iOSDevice64/
iOSDevice/
iOSSimulator/
Win32/
Win64/
Android/
Osx32/
OSX64/
#Steve usual folders
_Extras/
DB/
Docs/
Icons/
Img/
Tools/
*~
.DS_Store
# Delphi compiler-generated binaries (safe to delete)
!.vscode/extensions.json
!.vscode/launch.json
!.vscode/settings.json
!.vscode/tasks.json
*.~*
# Castalia statistics file (since XE7 Castalia is distributed with Delphi)
*.a
*.apk
*.bin
*.bpi
*.bpl
*.cbk
*.cfg
*.dcp
*.dcu
*.dll
*.drc
*.dres
*.dsk
*.dsv
*.exe
*.fb8lck # Lock files
*.fbl8 # Log files
*.fbpbrk # Breakpoints
*.fbpInf # Project info cache
*.ico
*.identcache
*.jpg
*.lib
*.local
*.map
*.o
*.ocx
*.png
*.projdata
*.res
*.rsm
*.save
*.so
*.stat
# Boss dependency manager vendor folder https://github.com/HashLoad/boss
modules/
*.tds
*.tlb
*.tvsconfig
*.user
*.vlb
.claude/settings.local.json
.DS_Store
.gitignore
.hg/
.svn/
.vscode/*
~$*.*
bin/

Binary file not shown.

14
BatteryHealth.dpr Normal file
View file

@ -0,0 +1,14 @@
program BatteryHealth;
uses
Vcl.Forms,
main in 'main.pas' {frmMain};
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TfrmMain, frmMain);
Application.Run;
end.

1191
BatteryHealth.dproj Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,10 @@
# TiltTeamPresence
Simulates a fake activity on your computer by moving the mouse back and forth by 2 pixels to keep the session active.
Simulates a fake activity on your computer by moving the mouse back and forth by 2 pixels to keep the session active.
Fake "battery health measurement" app that actually moves the mouse 2 pixels in each directions, back and forth.
This is to simulate an activity from the user so that apps like Teams don't switch the Green status to Orange one (present but inactive).
It uses a thread so the user still can click the Stop button to regain control.
Use it at your own risks and responsabilities.

44
main.dfm Normal file
View file

@ -0,0 +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

103
main.pas Normal file
View file

@ -0,0 +1,103 @@
unit main;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls, Vcl.ComCtrls, System.Threading;
type
TfrmMain = class(TForm)
btnStart: TButton;
progressBar: TProgressBar;
lblStatus: TLabel;
procedure FormCreate(Sender: TObject);
procedure btnStartClick(Sender: TObject);
private
{ Private declarations }
FMyTask : ITask ;
procedure startTask ;
procedure stopTask ;
public
{ Public declarations }
end;
var
frmMain : TfrmMain ;
direction : Boolean ;
runIt : Boolean ;
implementation
{$R *.dfm}
procedure TfrmMain.FormCreate(Sender: TObject);
begin
direction := False ;
runIt := False ;
end;
procedure TfrmMain.btnStartClick(Sender: TObject);
begin
runIt := NOT runIt ;
if runIt then
begin
btnStart.Caption := 'Stop Monitoring' ;
startTask ;
end
else
begin
btnStart.Caption := 'Start Monitoring' ;
stopTask ;
end;
end;
procedure TfrmMain.startTask;
begin
lblStatus.Caption := 'Measuring' ;
// Create and start the background task
FMyTask := TTask.Run(
procedure
begin
// Check if the Stop button was clicked
if TTask.CurrentTask.Status = TTaskStatus.Canceled then
Exit; // Gracefully exit the thread loop
// Simulate work (e.g., 500ms step)
while runIt do
begin
Sleep(1000);
// 2. Safely update the UI progress
TThread.Queue(nil,
procedure
begin
direction := Not direction ;
if direction then
mouse.CursorPos := Point( mouse.CursorPos.X + 2, mouse.CursorPos.Y + 2 )
else
mouse.CursorPos := Point( mouse.CursorPos.X - 2, mouse.CursorPos.Y - 2 )
end);
end;
end);
end;
procedure TfrmMain.stopTask;
begin
if (FMyTask <> nil ) then
begin
lblStatus.Caption := '' ;
FMyTask.Cancel ;
end;
end;
end.