# How to install macros on a Logitech mouse

> How to properly install macros on a Logitech mouse: from setting up G HUB to switching weapon modes. An up-to-date 2026 guide.

URL: https://promacro.ru/en/instructions/how-to-install-macro-on-logitech-g-mouse/
Updated: 2026-11-24

## What mice are suitable?

Installing macros, or more precisely `Lua` programs, into a G HUB script **is identical for all Logitech mouse models supported by G HUB (G and PRO series)**. Other mice, especially those from third-party brands, will definitely not work.

### Mice supported by Logitech G HUB
<div class="step-body">

Logitech G102 Prodigy, Logitech G102 LIGHTSYNC, Logitech G103 Prodigy, Logitech G203 Prodigy, Logitech G203 LIGHTSYNC, Logitech G302 Daedalus Prime, Logitech G303 Daedalus Apex, Logitech G303 SHROUD EDITION, Logitech G304 LIGHTSPEED, Logitech G304 SE / G305 SE LIGHTSPEED, Logitech G305 LIGHTSPEED, Logitech G305 X, Logitech G305 X SUPERLIGHT, Logitech G309 LIGHTSPEED, Logitech G402 Hyperion Fury, Logitech G403 Prodigy, Logitech G403 Prodigy Wireless, Logitech G403 HERO, Logitech G502 Proteus Core, Logitech G502 Proteus Spectrum, Logitech G502 HERO, Logitech G502 LIGHTSPEED, Logitech G502 X, Logitech G502 X LIGHTSPEED, Logitech G502 X PLUS, Logitech G600 MMO, Logitech G602, Logitech G603 LIGHTSPEED, Logitech G604 LIGHTSPEED, Logitech G703 LIGHTSPEED, Logitech G703 LIGHTSPEED HERO, Logitech G705, Logitech G900 Chaos Spectrum, Logitech G903 LIGHTSPEED, Logitech G903 LIGHTSPEED HERO, Logitech MX518, Logitech PRO Gaming Mouse, Logitech PRO HERO, Logitech PRO Wireless, Logitech PRO X SUPERLIGHT, Logitech PRO X SUPERLIGHT 2, Logitech PRO X SUPERLIGHT 2 SE, Logitech PRO X SUPERLIGHT 2 DEX, Logitech PRO X SUPERLIGHT 2 DEX SE, Logitech PRO X SUPERLIGHT 2C, Logitech PRO X SUPERLIGHT 2C SE, Logitech PRO 2 LIGHTSPEED, Logitech PRO X2 SUPERSTRIKE, Logitech PRO X3 SUPERSTRIKE.

<p class="device-list-source">This list draws on Logitech’s official websites and manuals.</p>

</div>

Special and limited editions (for example, G502 HERO SE or color versions) work the same as the base model.

## Video guide

<figure class="video" data-video data-youtube="2HNNMqYPiUM" data-rutube="f93bddb3a83d9a0ff057c98b3837b7b3" data-title="How to install macros on a Logitech mouse"><a class="video__play" href="https://rutube.ru/video/f93bddb3a83d9a0ff057c98b3837b7b3/" target="_blank" rel="noopener">![](https://promacro.ru/en/_astro/logitech-g-hub.B5P1d6O7_Zf6A4B.webp)<span class="video__button" aria-hidden="true"></span><span class="video__title">How to install macros on a Logitech mouse</span></a><figcaption class="video__links"><a href="https://www.youtube.com/watch?v=2HNNMqYPiUM" target="_blank" rel="noopener" data-platform="youtube">YouTube</a> · <a href="https://rutube.ru/video/f93bddb3a83d9a0ff057c98b3837b7b3/" target="_blank" rel="noopener" data-platform="rutube">RUTUBE</a></figcaption></figure>

<section class="installation-guide">

## Step-by-step guide

<details name="installation-steps">
<summary>

### On-board Memory Mode

</summary>
<div class="step-body">

"On-board Memory Mode" **must be disabled**, otherwise macros (from `Lua` programs) **will not work** in this mode.

![G HUB On-board Memory Mode](https://promacro.ru/en/_astro/How-to-import-Lua-scripts-with-macros-in-G-HUB-Logitech-mouse-On-board-Memory-Mode.D3pFD_yP_Z1nIGHH.webp)

</div>

<details name="installation-steps">
<summary>

### Persistent default profile

</summary>
<div class="step-body">

Go to **"Profiles"** and make sure your persistent default profile is set to **"Desktop"**.

![G HUB Profiles](https://promacro.ru/en/_astro/How-to-import-Lua-scripts-with-macros-in-G-HUB-Logitech-mouse-Profiles.l7aP0lrD_ZLJ6UB.webp)

*"Profiles" in Logitech G HUB*

![G HUB Profile switching](https://promacro.ru/en/_astro/How-to-import-Lua-scripts-with-macros-in-G-HUB-Logitech-mouse-Profile-switching.D-CO7tyi_QQh6m.webp)

*The persistent default profile is "Desktop"*

If you set a persistent profile **other than Desktop**, for example a game profile, there is a chance that **macros (the `Lua` program) will not work**.

</div>

<details name="installation-steps">
<summary>

### Creating a `Lua` script

</summary>
<div class="step-body">

Now go to the **"Desktop"** profile and click **"Create LUA Script"**.

![G HUB Desktop Profile](https://promacro.ru/en/_astro/How-to-import-Lua-scripts-with-macros-in-G-HUB-Logitech-mouse-Desktop-Profile.BpAOXN8F_SANa0.webp)

*Going to the "Desktop" profile*

![Create LUA Script in G HUB](https://promacro.ru/en/_astro/How-to-import-Lua-scripts-with-macros-in-G-HUB-Logitech-mouse-Create-LUA-Script.dRRJLXok_ZglMAF.webp)

*Creating a script for the Lua program*

Click the **"CREATE A NEW LUA SCRIPT"** button.

![CREATE A NEW LUA SCRIPT button](https://promacro.ru/en/_astro/How-to-import-Lua-scripts-with-macros-in-G-HUB-Logitech-mouse-CREATE-A-NEW-LUA-SCRIPT.Cmzv9e4R_LJgj.webp)

</div>

<details name="installation-steps">
<summary>

### G HUB script console

</summary>
<div class="step-body">

You've created a new script, and at the bottom there's an area (highlighted in red): the script console. If you don't have it for some reason, or you closed it by accident, be sure to open it.

![G HUB Script Console](https://promacro.ru/en/_astro/How-to-import-Lua-scripts-with-macros-in-G-HUB-Logitech-mouse-G-HUB-Script-Console.CvodoDP9_Z29FF9E.webp)

*Clean script and the G HUB console window*

To open the console, open the **View** menu tab and click **Console**.

![G HUB Script Console View menu](https://promacro.ru/en/_astro/How-to-import-Lua-scripts-with-macros-in-G-HUB-Logitech-mouse-G-HUB-Script-Console-View-menu.Dmt501YD_Z26Fnv9.webp)

![G HUB Script Console show console](https://promacro.ru/en/_astro/How-to-import-Lua-scripts-with-macros-in-G-HUB-Logitech-mouse-G-HUB-Script-Console-show-console.9-4qstrY_2uJ3dE.webp)

</div>

<details name="installation-steps">
<summary>

### Importing the `Lua` program (macros)

</summary>
<div class="step-body">

Go to the **Script** menu and click **Import**.

![Script menu G HUB](https://promacro.ru/en/_astro/How-to-import-Lua-scripts-with-macros-in-G-HUB-Logitech-mouse-Script-menu.DHJehoaX_xBjDB.webp)

![Script Import G HUB](https://promacro.ru/en/_astro/How-to-import-Lua-scripts-with-macros-in-G-HUB-Logitech-mouse-Script-Import.DAUxzXO5_HAjmK.webp)

In the window that opens, **choose the `Lua` program** to load into the script.

![Choosing the Lua program to import in G HUB](https://promacro.ru/en/_astro/How-to-import-Lua-scripts-with-macros-in-G-HUB-Logitech-mouse-select-script-for-import.B4sWQIPu_Z1QDObT.webp)

</div>

<details name="installation-steps">
<summary>

### Running the `Lua` program

</summary>
<div class="step-body">

Go to the **Script** menu and click **Save and Run**.

![Script menu G HUB](https://promacro.ru/en/_astro/How-to-import-Lua-scripts-with-macros-in-G-HUB-Logitech-mouse-active-script-menu.DJp-onXI_Z1EuW21.webp)

![Save and run Lua script](https://promacro.ru/en/_astro/How-to-import-Lua-scripts-with-macros-in-G-HUB-Logitech-mouse-save-and-run-Lua-script.Bnx-pMz0_S5vkD.webp)

After launching, if the `Lua` program is written correctly, there should be no error messages in the G HUB console. If you're using our programs, a **welcome message** appears in the console.

![Welcome message in the G HUB console](https://promacro.ru/en/_astro/How-to-import-Lua-scripts-with-macros-in-G-HUB-Logitech-mouse-welcome-message-in-the-console.BfJ34L3i_Zw9h3t.webp)

*Loaded and active Lua program in a G HUB script*

</div>

<details name="installation-steps">
<summary>

### Activating weapon modes

</summary>
<div class="step-body">

The top of the script lists the weapon shortcuts. For example, in the current Apex Legends packs, hold **Right Alt** and press **mouse button 4** to select C.A.R.

If everything is done correctly, the G HUB console shows a message that the mode for C.A.R. is active.

For the macros of this mode to start working, turn on **CapsLock** (the G HUB console reminds you if it's off) and hold **RMB** (right mouse button, aiming mode in the game) + **LMB** (left mouse button).

![CapsLock reminder in the G HUB console](https://promacro.ru/en/_astro/How-to-import-Lua-scripts-with-macros-in-G-HUB-Logitech-mouse-capslock-must-be-enabled.B5Y0M7P0_Z1hWj1n.webp)

Don't forget to set your game settings according to the **pack requirements** (of the `Lua` program) to get the **maximum recoil reduction**.

</div>

</section>

## Assigning weapons to Logitech keyboard G keys
The Logitech packs for PUBG, CS2 and Apex Legends support keyboard G keys in **MINI PACK, STANDARD PACK and MAX PACK**. Use a compatible Logitech keyboard whose G keys are available to G HUB scripts.

Open the pack file and find the variable for your weapon ending in `_G_BUTTON`. For example, in CS2, `AK47_G_BUTTON = 3` assigns AK47 to G3. Save and restart the script. To restore the standard keyboard and mouse shortcut, set the value to `0`. [G-key assignments by game and weapon](https://promacro.ru/en/knowledge-base/lua-variables/#weaponname-g-button).

<figure class="video" data-video data-youtube="wI2gzAWRNxk" data-rutube="58c30bfacb2f75d196f2cdc2683237c8" data-title="Key binding on Logitech G keyboards"><a class="video__play" href="https://rutube.ru/video/58c30bfacb2f75d196f2cdc2683237c8/" target="_blank" rel="noopener">![](https://promacro.ru/en/video/logitech-g-keys.webp)<span class="video__button" aria-hidden="true"></span><span class="video__title">Key binding on Logitech G keyboards</span></a><figcaption class="video__links"><a href="https://www.youtube.com/watch?v=wI2gzAWRNxk" target="_blank" rel="noopener" data-platform="youtube">YouTube</a> · <a href="https://rutube.ru/video/58c30bfacb2f75d196f2cdc2683237c8/" target="_blank" rel="noopener" data-platform="rutube">RUTUBE</a></figcaption></figure>

## The most common G HUB problems and their solutions

It often happens that after connecting a new mouse or updating G HUB, users run into various problems. Thanks to our tech support experience, we've collected (and keep collecting) [**all known Logitech G HUB problems and their solutions in a separate article**](https://promacro.ru/en/instructions/logitech-g-hub-issues-and-solutions/).
