This is a simple command-line tool for macOS designed to monitor and simulate keyboard and mouse input events. You can use it to record a sequence of actions and then replay (simulate) them.
- Event Monitoring: Records keyboard key presses/releases and mouse actions (movements, clicks, scrolls).
- Event Management:
- Display recorded keyboard or mouse events.
- Sort events by timestamp.
- Clear recorded events.
- Save & Load:
- Save the recorded event sequence to a file.
- Load an event sequence from a file.
- Simulation:
- Automatically execute simulated keyboard and mouse actions based on the loaded or recorded event sequence.
- Status Display: Check the current status of the monitor (running or stopped).
- Operating System: macOS
- Compiler: A C++14 compliant compiler (e.g., g++ or clang)
- Framework: macOS ApplicationServices Framework (configured in the
makefile)
-
Get the Source Code:
# If cloning from a Git repository git clone <your-repository-url> cd inputs_emulator # Ignore git clone if you are already in the local project directory
-
Clean (Optional): Remove previous build files.
make clean
-
Compile: Use the
makefileto compile the project.make
Upon successful compilation, the executable
input_simulatorwill be generated in thedebug/directory.
-
Run the Application: In your terminal, navigate to the project's root directory and execute:
./debug/input_simulator
-
Main Menu: The application will display a menu. Enter the corresponding number to select an action:
[1]Exit the application.[2]Start Monitor: Begin recording keyboard and mouse events. Press theEscapekey to stop monitoring.[3-5]Print Events: View recorded keyboard, mouse, or all events.[6]Sort Events: Sort all events chronologically (recommended before simulation).[7]Clear Events: Delete all recorded events.[8]Save Events: Save the currently recorded events to a specified file.[9]Load Events: Load events from a specified file, overwriting any current events.[10]Run Simulation: Execute the simulated actions based on the currently loaded/recorded event sequence.[11]Show Status: Check if the monitor is currently running or stopped.
- Add support for more event types (e.g., modifier keys, precise drag simulation).
- Provide more detailed error handling and user feedback.
- Develop a graphical user interface (GUI).