# Universal customizable macro G.MACRO

> Universal customizable macro G.MACRO for Logitech (G HUB) mice. Recoil control, clicker, simulated randomness and more!

URL: https://promacro.ru/en/universal-macros-logitech-g/
Updated: 2026-11-29

G.MACRO is not just a macro or a script, it is a full-fledged program for Logitech (G HUB) mice that allows you to change macro parameters on the fly, right in the game, adjust to recoil, make automatic weapons from any semi-automatic and much more!

The set of functions depends entirely on the version of G.MACRO you choose.

> **Important!** In some games, Logitech G HUB is blocked and cannot perform any actions. Before purchasing, make sure that any Lua programs and macros work in your game via Logitech G HUB (any Lua programs that move the mouse are suitable for this). Just launch the game and try to move the mouse in a match with such a Lua program: if it works, G.MACRO will work too.

[Video: Universal customizable macro G.MACRO — video](https://www.youtube.com/watch?v=aizlaiMZj6Y)

## Who is G.MACRO for?
G.MACRO works only on Logitech mice supported by G HUB. It's ideal for any game with linear recoil where G HUB works, and it adapts to the recoil right in the game, whatever the weapon, attachments or your game settings.

## G.MACRO Versions
G.MINIMAL lets you adjust vertical compensation. G.STANDARD adds horizontal adjustment. G.PROFESSIONAL adds adjustable delay, axis inversion and an option to start with RMB held. G.MAXIMAL also includes a clicker.

![G.PROFESSIONAL startup screen showing the available functions and their shortcuts](https://promacro.ru/en/_astro/g-professional-startup.DkfXoMAJ_Z1UHqmS.webp)

*Each edition lists its functions and shortcuts when it starts. This example shows G.PROFESSIONAL.*

### G.MINIMAL
- **VERTICAL RECOIL CONTROL** - control of vertical recoil with macro sensitivity change on the fly for different weapons, modules and settings.
- **SHOW SETTINGS** - Shows the current macro settings for the VERTICAL RECOIL CONTROL parameter.

### G.STANDARD
- **VERTICAL + HORIZONTAL RECOIL CONTROL** - control of vertical and horizontal recoil with macro sensitivity change on the fly for different weapons, modules and settings.
- **SHOW SETTINGS** - Shows the current VERTICAL and HORIZONTAL RECOIL CONTROL parameter macro settings.

### G.PROFESSIONAL
- **VERTICAL + HORIZONTAL RECOIL CONTROL** - control of vertical and horizontal recoil with macro sensitivity change on the fly for different weapons, modules and settings.
- **DELAY CONTROL** - change the delay between macro movements, this will make the macro smoother or vice versa sharper.
- **LMB + RMB MODE** — with Scroll Lock on, hold RMB before pressing LMB. You can release RMB once the burst starts.
- **INVERSION** - inversion of any of the axes of the macro (required if you play with inversion enabled).
- **SHOW SETTINGS** - Shows the current VERTICAL, HORIZONTAL RECOIL CONTROL and DELAY CONTROL parameter macro settings.

### G.MAXIMAL
- **VERTICAL + HORIZONTAL RECOIL CONTROL** - control of vertical and horizontal recoil with macro sensitivity change on the fly for different weapons, modules and settings.
- **DELAY CONTROL** - change the delay between macro movements, this will make the macro smoother or vice versa sharper.
- **LMB + RMB MODE** — with Scroll Lock on, hold RMB before pressing LMB. You can release RMB once the burst starts.
- **INVERSION** - inversion of any of the axes of the macro (required if you play with inversion enabled).
- **CLICKER MODE** - automatic LMB clicker with adjustable click frequency via DELAY CONTROL.
- **SHOW SETTINGS** - Shows the current VERTICAL, HORIZONTAL RECOIL CONTROL and DELAY CONTROL parameter macro settings.

### G.MACRO Call of Duty Edition
This edition has two profiles. The first starts at X = 0, Y = 10 and a 25 ms delay. The second starts at X = 0, Y = 5 and 15 ms. Right Shift + a wheel click switches profiles. Left Alt + a wheel click toggles X/Y jitter. Starting normal compensation requires RMB by default (`REQUIRE_RMB = true`). You can assign controls to G keys on a compatible Logitech keyboard. [More about the Call of Duty edition](https://promacro.ru/en/macros-for-call-of-duty/).

## G.MACRO controls
In all five editions, click the wheel without holding a keyboard key to open help in the [G HUB script console](https://promacro.ru/en/knowledge-base/terms/#g-hub-console). For a shortcut, hold the keyboard key first, then press the mouse button. Mouse button 3 is the wheel click.

### G.MINIMAL
**Modes:**

- [CapsLock](https://promacro.ru/en/knowledge-base/terms/#capslock) on/off: turns the macro on and off.
- Left SHIFT + mouse button 3: shows the current settings (VERTICAL RECOIL CONTROL) in the G HUB console.

**Control:**

- Left ALT + mouse button 5: vertical sensitivity +1.
- Left ALT + mouse button 4: vertical sensitivity −1.

### G.STANDARD
**Modes:**

- CapsLock on/off: turns the macro on and off.
- Left SHIFT + mouse button 3: shows the current settings (VERTICAL and HORIZONTAL RECOIL CONTROL) in the G HUB console.

**Control:**

- Left ALT + mouse button 5: vertical sensitivity +1.
- Left ALT + mouse button 4: vertical sensitivity −1.
- Left CTRL + mouse button 5: horizontal sensitivity +1.
- Left CTRL + mouse button 4: horizontal sensitivity −1.

### G.PROFESSIONAL
**Modes:**

- CapsLock on/off: turns the macro on and off.
- ScrollLock on/off: turns RMB + LMB mode on and off.
- Left SHIFT + mouse button 3: shows the current settings (VERTICAL, HORIZONTAL RECOIL CONTROL and DELAY CONTROL) in the G HUB console.

**Control:**

- Left ALT + mouse button 5: vertical sensitivity +1.
- Left ALT + mouse button 4: vertical sensitivity −1.
- Left CTRL + mouse button 5: horizontal sensitivity +1.
- Left CTRL + mouse button 4: horizontal sensitivity −1.
- Left SHIFT + mouse button 5: delay between movements +1.
- Left SHIFT + mouse button 4: delay between movements −1.

### G.MAXIMAL
**Modes:**

- CapsLock on/off: turns the macro on and off.
- ScrollLock on/off: turns RMB + LMB mode on and off.
- Left SHIFT + mouse button 3: shows the current settings (VERTICAL, HORIZONTAL RECOIL CONTROL and DELAY CONTROL) in the G HUB console.
- Left CTRL + mouse button 3: turns the LMB clicker on and off. The clicker works while you hold left ALT + LMB.

**Control:**

- Left ALT + mouse button 5: vertical sensitivity +1.
- Left ALT + mouse button 4: vertical sensitivity −1.
- Left CTRL + mouse button 5: horizontal sensitivity +1.
- Left CTRL + mouse button 4: horizontal sensitivity −1.
- Left SHIFT + mouse button 5: delay between movements/clicks +1.
- Left SHIFT + mouse button 4: delay between movements/clicks −1.

## Your own macro based on G.MACRO
Once you've tuned the settings for a specific weapon, you can save G.MACRO of any version as a separate macro with those parameters built in.

### G.MACRO parameters
All parameters are in a separate block at the very top of the program. Open G.MACRO in Logitech G HUB or any text editor: the parameter list is at the top of the file. Their number depends on the G.MACRO version.

The examples below use the current names. If your file contains `defaultSensitivityAxisX` or `HUMAN_RANDOM`, see [legacy variables](https://promacro.ru/en/knowledge-base/lua-variables/#legacy-variables).

```lua
local LANGUAGE = "RU"
local DEFAULT_SENSITIVITY_X = 0
local DEFAULT_SENSITIVITY_Y = 0
local DEFAULT_DELAY_MS = 15
local INVERSION_X = 1 --SET -1 FOR INVERSION
local INVERSION_Y = 1 --SET -1 FOR INVERSION
local CLICKER_MODE = false
local SECOND_AUTO_BUTTON = "lalt"
local HELP_MODE = true
local RANDOM_XY_MODE = false
local RANDOM_DELAY_MODE = false
local RANDOM_XY_VALUE = 1
```

*G.MAXIMAL.MACRO parameters*

- `DEFAULT_SENSITIVITY_X`: movement on the horizontal axis (X). Any integer.
- `DEFAULT_SENSITIVITY_Y`: movement on the vertical axis (Y). Any integer.
- `DEFAULT_DELAY_MS`: delay between movements in milliseconds. An integer from 1.
- `INVERSION_X`: horizontal axis inversion, `1` (off) or `-1` (on).
- `INVERSION_Y`: vertical axis inversion, `1` (off) or `-1` (on).
- `CLICKER_MODE`: clicker mode, `false` (off) or `true` (on).
- `SECOND_AUTO_BUTTON`: the second button you hold together with LMB for automatic fire in clicker mode: `"lalt"` (left ALT), `"ralt"` (right ALT), `"alt"` (either ALT), and likewise `"lshift"`, `"rshift"`, `"shift"`, `"lctrl"`, `"rctrl"` or `"ctrl"`.
- In every edition, `LANGUAGE` sets the console language (default `"RU"`, use `"EN"` for English). `HELP_MODE` enables help on wheel click.
- `RANDOM_XY_MODE` and `RANDOM_DELAY_MODE` independently enable movement jitter and delay variation. Both are off by default. `RANDOM_XY_VALUE` sets the amount of movement jitter.

### Current parameters
Every G.MACRO has a SHOW SETTINGS function: press left SHIFT and the mouse wheel, and the main macro parameters appear in the G HUB console.

```text
****************************
HORIZONTAL SENSITIVITY (X): 0
VERTICAL SENSITIVITY (Y): 6
MACRO DELAY: 40
****************************
```

- **HORIZONTAL SENSITIVITY (X): 0** is the `DEFAULT_SENSITIVITY_X` parameter.
- **VERTICAL SENSITIVITY (Y): 6** is the `DEFAULT_SENSITIVITY_Y` parameter.
- **MACRO DELAY: 40** is the `DEFAULT_DELAY_MS` parameter.

### Saving your macro
Copy the console values into the settings at the top of the script. Set Y in G.MINIMAL, or X and Y in G.STANDARD. The example below applies to G.PROFESSIONAL and G.MAXIMAL: keep X at 0, set Y to 6 and the delay to 40 ms. In CoD Edition, edit the settings prefixed with `MODE_1_` or `MODE_2_` for the profile you want.

<div class="img-row">
<div>

```lua
local DEFAULT_SENSITIVITY_X = 0
local DEFAULT_SENSITIVITY_Y = 0
local DEFAULT_DELAY_MS = 15
```

*Before*

</div>
<div>

```lua
local DEFAULT_SENSITIVITY_X = 0
local DEFAULT_SENSITIVITY_Y = 6
local DEFAULT_DELAY_MS = 40
```

*After*

</div>
</div>

Now open the "Script" menu and click "Export".

![Exporting a new macro based on G.MACRO](https://promacro.ru/en/_astro/exporting-a-new-macro-based-on-g-macro.PLDdaEnS_1cL5xd.webp)

Pick a new name for the macro: this matters, so you don't accidentally overwrite your base G.MACRO. For a macro tuned for the AK47, for example, call it that.

![Saving a new macro based on G.MACRO](https://promacro.ru/en/_astro/saving-a-new-macro-based-on-g-macro.C-a0NGdd_1RDaTK.webp)

Done: once loaded into G HUB, this macro comes with your parameters for that specific weapon.

The new macro file: `G.MACRO AK47.lua`.

You can make macros like this for different weapons with different parameters, and with G.MAXIMAL a clicker macro too.

<span id="useful-title"></span>
