Auto Clicker is a powerful Windows tool designed to automate mouse clicks and keyboard inputs with precision and flexibility. This software supports both repetitive task automation and complex sequences through a robust interface and deep system integration. In this post, I’ll explore the technical aspects behind Auto Clicker, covering its UI, core functionality, and advanced scripting capabilities.

Core Functionality: Windows API Integration

At its core, Auto Clicker is a C# wrapper around the Windows API, allowing the program to listen for user inputs and simulate mouse and keyboard actions. The software interacts with Windows at a system level to provide precise control over automation.

How It Works:

  1. Simulating Clicks and Keystrokes: Using functions like SendInput and PostMessage from the Windows API, Auto Clicker can replicate user actions with high accuracy.
  2. Listening for Inputs: The program hooks into Windows’ low-level keyboard and mouse input listeners to detect user actions for recordings and to start/stop the clicker.
  3. Customizable Execution: Users can configure delays, repetitions, and specific conditions to fine-tune automation behavior.

This direct API access ensures minimal latency and maximum control over input simulation, making it ideal for both simple and complex automation tasks.


Standard Mode – Basic functionality: Interval, Repeat, Mouse Buttons, etc.

UI: The Role of Blazor MAUI

Auto Clicker’s user interface is built using Blazor MAUI, a modern framework that allows .NET developers to create cross-platform applications. While Blazor MAUI offers several benefits, it also comes with some limitations:

Positives:

  • Unified Codebase: Blazor MAUI enables developers to use C# and .NET to build both the front-end and back-end, reducing the need to switch between different languages.
  • Web-Like Experience: Since Blazor leverages WebAssembly, UI elements can be designed in a way that feels similar to web development, making it more intuitive and enabling the use of a vast amount of libraries for web development.

Negatives:

  • Performance Considerations: Compared to traditional native Windows UI frameworks like WinForms or WPF, Blazor MAUI may introduce some overhead, particularly in UI rendering speed.
  • Windows-Specific Limitations: Since Auto Clicker relies on Windows API hooks, the cross-platform benefits of Blazor MAUI aren’t fully utilized in this case.

Advanced Mode: Drag-and-Drop Automation with Blazor Sortable

For users seeking more powerful automation, Blazor Sortable, which integrates Sortable.js, was used to create Advanced Mode with a block-based approach. The goal was to provide a visual, scripting-like interface where users can drag and drop predefined action blocks into a sequence, allowing them to define the flow of automation as needed.

Each block represents a specific action—such as a click, a keypress, an interval, or a repetition loop—giving users clear control over execution. The drag-and-drop UI simplifies rearranging blocks and customizing automation sequences, enabling flexibility without coding.

Once blocks are arranged, the automation runs step by step, executing each action in order. This structured approach helps users visualize and manage automation tasks, even as they become more complex.

To ensure smooth execution, heavy tasks like image processing are initialized before the clicker starts. This process may take a few milliseconds or seconds, depending on the number of blocks, but ensures high CPS once initialization is complete.


Advanced Mode – Block-based automation: Drag, drop, and sequence actions.

Blocks:

  • Click Block: Simulates mouse clicks, which map to either SendInput or PostMessage commands depending on the configured parameters. PostMessage is used when you don’t want the cursor to move or when you want to click relative to the window. The drag option records the mouse movement and stores the points the mouse travels, allowing the drag action to be repeated by sending the inputs for all of the positions.
  • Move Block: Moves the cursor to a specified location. It works similarly to the Click Block but without the click after moving the cursor.
  • Scroll Block: Simulates scrolling actions, which also map to SendInput.
  • Interval Block: Executes a delay or interval, controlling the amount of time between actions. It simply introduces a delay between actions, without any additional functionality.
  • Repeat Block: Repeats actions a specific number of times or until the clicker is stopped. This is the main block that is always available by default, but you can also set up new loops inside the main loop. It functions as a simple “for” loop that executes the blocks contained within.
  • Detection Block: Detects images or colors. The image detection uses the OpenCV library Template Matching and Feature Detection algorithms to find the provided image on the screen and determine the point at its center, which can then be used in other blocks as the “Detected Point” (for clicking, for example). The color detection checks every pixel within the provided detection area, using a tolerance level to verify if it matches the specified color. You can limit the detection area to improve processing speed and focus on a smaller portion of the screen. The block also includes actions to execute on success or failure.
  • Key Block: Simulates a key press, which also maps to SendInput.
  • Random Block: Executes one of the blocks inside it at random. This block is useful for introducing randomness into your automation workflow by randomly choosing and executing one of the contained blocks.
  • Custom Block: A block that combines multiple other blocks into a single action sequence. You can group different blocks together inside the custom block to create more complex automation sequences.

Recording Mode: Capture and Edit Your Actions

Recording Mode was designed for simplicity and flexibility, allowing users to capture input actions and automatically map them to designated blocks in Advanced Mode. This enables recording actions as they are performed, without requiring complex setup. Once recorded, actions are organized into blocks, providing a clear visual representation of the workflow.

To ensure full control over recordings, users can edit them in Advanced Mode by rearranging, deleting, or modifying blocks as needed. This allows for precise customization of the automation sequence.

Recording Mode also offers control over which actions are captured, enabling users to select only necessary inputs. This prevents unnecessary actions from bloating the sequence, keeping automation clean and efficient.

This design approach prioritizes an intuitive and powerful automation process. Recording Mode and Advanced Mode function together to help users create, adjust, and refine automation with minimal effort.

Recording Mode – Capture and map actions into blocks for easy automation.

One issue with this design is that, to prevent the recording from becoming bloated with numerous blocks indicating mouse movement, I initially recorded only user actions such as clicks and keypresses while adding intervals between them. This approach works in many situations, but some require continuous movement recording.

To address this, I created a single move block that captures all movement from the start of the recording and runs it in parallel. This prevents excessive bloating while maintaining smooth motion, though it makes movement actions non-editable.

Here’s the code that achieves this:


Recording Mode – Add full recording move record.

It creates a move block with IsDrag and IsAsyncDrag, allowing the drag action to execute asynchronously. An interval block is also added to ensure synchronization with other actions. If the movement is relative to a window, the process name of the window is stored using the starting point.
In the update function, points are added to the drag path every few milliseconds. If the window changes, a new move block is generated for the new window.

Recording Mode – Update move drag path.

With this approach, we achieve a more structured recording for editing in Advanced Mode.

Macros: Automating with Key Presses

With Macros, I’ve made it possible for users to execute a custom block of actions whenever you press a specific key. This adds a whole new layer to the system, making it even more complete by allowing the creation of both automatic and semi-automatic workflows.

This allows users to define when and how automation tasks execute in real time. Macros can trigger both simple and complex action sequences as needed. They are useful for tasks that typically require manual input, enabling more efficient workflow execution while maintaining user control.

Macros for semi-automatic setups.

Conclusion

In conclusion, Auto Clicker offers a powerful and flexible solution for automating mouse clicks and keyboard inputs, making it an essential tool for streamlining repetitive tasks or creating intricate automation workflows. With its deep integration into the Windows API, Auto Clicker ensures precise control over automation, providing both simple and advanced features to suit various use cases.

The intuitive user interface, built with Blazor MAUI, combined with the drag-and-drop functionality of the Advanced Mode, empowers users to easily design custom automation sequences. Blocks like Click, Move, Scroll, Repeat, and Detection enable the creation of versatile scripts, while features like Recording Mode and Macros add even more flexibility and control.

Auto Clicker supports both basic automation and complex workflows, providing an efficient and structured approach to task automation.

Get Auto Clicker now!