A Python utility for simulating human-like mouse movement and task switching โ useful for automation, UI testing, and system interaction simulations.
HMI-Sim (Human-Machine Interaction Simulator) is a lightweight Python script designed to programmatically simulate human input patterns, including dynamic mouse movements and application switching via keyboard shortcuts.
It provides an easy way to mimic basic input activity for development, testing, or automation workflows where synthetic interaction is required โ such as simulating user behavior for demos, system monitoring tools, or GUI test environments.
Win + [Number]config.ini file with randomized ranges for natural variabilityNote: HMI-Sim is intended for use in testing, automation, and simulation workflows. It is not intended for deceptive use.
Install via pip:
pip install hmi-sim
Or clone the repository and run directly:
git clone https://github.com/rohitlal125555/hmi-sim.git
cd hmi_sim
python cli.py
You can run the simulator directly from the command line:
hmi-sim --duration <time>
You can control how long the simulation runs using the --duration argument. Supported formats:
s for seconds (e.g., 30s, 90s)m for minutes (e.g., 5m, 10m)h for hours (e.g., 1h, 2h)If you omit the
--durationflag, the simulation runs indefinitely until manually stopped.
To stop: press Ctrl + C.
All simulation configuration settings are defined in the config.ini file, which is automatically created on first run.
``~/.hmi-sim/config.ini
%USERPROFILE%\.hmi-sim\config.ini$HOME/.hmi-sim/config.ini[Settings]
; If enabled, the program speaks the app # and num mouse movements chosen for the sim
enable_audio = False
; Enable random clicks
enable_random_clicks = False
; Sleep time between each simulation
sleep_time_range = 30, 60
; Range of apps on task bar to switch between. For eg: 1 - means 1st icon on taskbar
taskbar_apps_range = 2, 6
; Number of intra-simulation mouse movements
num_mouse_movements = 1, 4
; Speed of mouse movement. For eg: 2 - means the mouse movement will take 2s to complete
mouse_movement_speed = 1, 3
You can adjust these ranges to suit your testing or simulation scenarios.
pyautoguipywin32 (only if enable_audio = True)Install dependencies manually (if cloned):
pip install pyautogui pywin32
This tool is provided for automation and testing purposes only.
The author assumes no responsibility for any unintended use of this utility. Users are expected to comply with all applicable laws, policies, and ethical standards.
Licensed under the Apache License 2.0.
Contributions, suggestions, and improvements are welcome! Please open an issue or submit a pull request.