Skip to content

Instantly share code, notes, and snippets.

@ewauq
Last active November 29, 2023 06:23
Show Gist options
  • Star 34 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save ewauq/2702c6b2342517a0ec9206fa101d3d7c to your computer and use it in GitHub Desktop.
Save ewauq/2702c6b2342517a0ec9206fa101d3d7c to your computer and use it in GitHub Desktop.
How to: Bind F13 to F24 keys on the G-keys (Logitech Gaming Keyboards)
-- How to use this script:
-- 1. Install the Logitech Gaming Software: http://support.logitech.com/en_us/software/lgs
-- 2. Launch it, and right click on your profile (the gear icon) and then click on "Scripts".
-- 3. Add the following code into the Script window, save it, and close it. Enjoy.
-- Now G1 is bound to F13, G2 to G14, ... G12 to F24.
function OnEvent(event, arg)
-- OutputLogMessage("event = %s, arg = %s\n", event, arg)
fKey = {
[1] = 0x64, -- F13
[2] = 0x65, -- F14
[3] = 0x66, -- F15
[4] = 0x67, -- F16
[5] = 0x68, -- F17
[6] = 0x69, -- F18
[7] = 0x6A, -- F19
[8] = 0x6B, -- F20
[9] = 0x6C, -- F21
[10] = 0x6D, -- F22
[11] = 0x6E, -- F23
[12] = 0x76 -- F24
}
if (event == "G_PRESSED") then
PressKey(fKey[arg])
end
if (event == "G_RELEASED") then
ReleaseKey(fKey[arg])
end
end
@nekolynx
Copy link

Thank you so much this is exactly what I was looking for!

@Absolutely-Knot
Copy link

This is fantastic! Does it go any higher than f24 or is that the limit? I'm trying to fill out my g13 with empty function keys

@ewauq
Copy link
Author

ewauq commented Oct 25, 2020

I am not sure, but I don't think there is more than 24 function keys.

@Absolutely-Knot
Copy link

Absolutely-Knot commented Oct 26, 2020

Thank you, I wasn't sure either. I wish there was lol

@icedterminal
Copy link

While this was extremely helpful in the past with Logi Gaming Software since it lacked bindings like this without scripting, it is no longer needed with Logi G Hub. You can now bind F13 through F24 through the UI to any of the G keys.

Screenshot 2021-02-05 155321

Those of you who use Gaming Software should remove it. It has been abandoned in favor of G Hub. It's last update was 2018-10-08. Newer devices are unsupported and Logitech no longer offers customer assistance with this software. They instead direct you to G Hub.

@c-drive
Copy link

c-drive commented Oct 19, 2021

What if I want to do this same thing to my G600 mouse. Those G keys are G9-G20

@TheTrueForce
Copy link

Those of you who use Gaming Software should remove it. It has been abandoned in favor of G Hub.

Has it improved any? Last time I used it, I lost all the profiles I'd set up after a reboot, so I immediately switched back to LGS, which still works fine with the occasional hiccup.

@icedterminal
Copy link

Has it improved any?

It has improved a lot since my comment. Logitech Gaming Software (LGS) profiles are stored at C:\Users\<name>\Appdata\Local\Logitech\Logitech Gaming Software\Profiles.

  1. Make sure LGHUB isn't installed at this time. Only LGS.
  2. Copy the Logitech folder from AppData to temporary location (Desktop for example).
  3. Uninstall LGS and reboot.
  4. Copy the Logitech folder back to AppData.
  5. Install LGHUB.
  6. From the LGHUB interface, click the cog/gear icon top right.
  7. Click "Import Profiles"
  8. LGHUB will find and import + convert LGS profiles to be usable with LGHUB.

Note: Some devices are not supported in LGHUB and those device specific settings in profiles will not carry over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment