What are mouse macros?

Updated

Contents

Mouse macros are a predefined sequence of actions that can include pressing certain mouse buttons and keyboard keys and moving the mouse pointer, run when you press a given mouse button.

A macro in the Bloody editor

Put a bit more strictly, macros (macro commands) are a set of instructions in a programming language or a special scripting language, usually built into a program together with its interpreter.

Where macros are used

Macros are useful wherever routine actions follow a known sequence:

  • in office applications;
  • in graphics editors;
  • in computer games (most often in MMORPGs);
  • in program code, for example when working with files.

The actions themselves can be calculations, key presses, mouse movements or interactions with a program’s or game’s interface.

Macros for gaming mice

Mice from some manufacturers let you program macros that press mouse buttons and move the pointer or crosshair in a game on their own. That’s exactly the kind of macros our project specialises in.

Macros and scripts: what’s the difference?

Scripts are programs used to automate all kinds of actions, while macros are just a special case of scripts written for a predefined runtime environment.

How macros work

It all comes down to two things:

  1. A set of commands.
  2. The conditions under which those commands start and stop.

Say you need to move the cursor 100 pixels to the right and click the left mouse button. The commands would look roughly like this:

  1. Move the cursor right by 100.
  2. Click the left mouse button.

The conditions are set right in the code along with the commands (as in Logitech G HUB) or as a separate setting in the program that plays the macro (A4Tech Bloody and Oscar for X7). For example:

  • run all the commands once when the left mouse button is pressed;
  • run while the left button is held and stop when it’s released;
  • repeat in a loop while the left button is held.

How flexible the conditions can be depends entirely on the scripting language.

We won’t go into the fact that movement can be relative or absolute, and a click consists of a press, a pause and a release. The main thing is to get the idea.

Hardware and software macros

A mouse macro’s actions can run at two completely different levels.

Hardware macros run inside the mouse itself and come from it just like normal player input. This is how macros work on A4Tech Bloody and X7 mice.

Software macros run through the system, via an interpreter program on your computer. This is how macros work on Logitech mice.

Many people believe that hardware macros, unlike software ones, can’t be detected and can be used in any game with impunity. That’s a myth: modern anti-cheats can detect any macros if the developers want to. More in “Can you get banned for using macros?”.

Macro formats for mice

Each mouse usually has its own format, and it’s important to know that far from every mouse with macros supports truly complex macros. Right now the most advanced macro mice come from Logitech, A4Tech and Razer.

Each of them has its own macro format: Logitech uses the Lua programming language, Razer uses the XML markup language, and, importantly, they all have different capabilities, described in more detail in “Best gaming mouse for macros”. All formats are collected on the macro formats page.

What macros can and can’t do

Macros have no access to the game process, so their capabilities are limited.

Macros for A4Tech press and release mouse buttons and keyboard keys and move the cursor, all with preset delays.

Macros for Logitech, thanks to the Lua language (a special version for Logitech), can do a bit more: change how macros are turned on, combine many macros in one program, switch between them and change their behaviour under extra conditions. There are also very specific features, such as showing information on a keyboard’s LCD display: they’re described in the official “G-series Lua API” documentation.

Mouse macros can’t:

  • read or change data in a game’s or application’s memory;
  • switch on their own depending on the weapon you picked in the game;
  • switch between windows;
  • do anything in a minimised application.

If you read somewhere that a macro detects or switches something by itself, it’s not a macro but a separate cheat program. You will get banned for it, 100%.