Logitech OBS G Key Macro

Did you know there are more function keys than what are currently on your keyboard? You may see only F1 through F12, but it goes all the way up to F24. This gives you more keys to play with when it comes macros. Normally these keys are accessed by pressing SHIFT and then the F key. But this creates a problem. For example OBS thinks this is the key combo you want to use, SHIFT + F1. Which we don't. We want want just F13. Thankfully, it's very easy to map this out.

G Hub

Gaming Software

Here is the script in full. If you don't need all the keys, remove some.

function OnEvent(event, arg)
-- OutputLogMessage("event = %s, arg = %s\n", event, arg)
fKey = {
[1] = 0x64, -- F13, this is G1
[2] = 0x65, -- F14, this is G2
[3] = 0x66, -- F15, this is G3
[4] = 0x67, -- F16, this is G4
[5] = 0x68, -- F17, this is G5
[6] = 0x69, -- F18, this is G6
[7] = 0x6A, -- F19, this is G7
[8] = 0x6B, -- F20, this is G8
[9] = 0x6C, -- F21, this is G9
[10] = 0x6D, -- F22, this is G10
[11] = 0x6E, -- F23, this is G11
[12] = 0x76 -- F24, this is G12
}
if (event == "G_PRESSED") then
PressKey(fKey[arg])
end
if (event == "G_RELEASED") then
ReleaseKey(fKey[arg])
end
end

When you're done, make you sure you save the script. Now how do you map them all? Open OBS and head to the hotkeys section in settings. For all of the actions you want bound to F13 through F24, press them with lower of the function keys. Remember, SHIFT + F1 will not give you F13. This means if you want Start / Stop Streaming to be F13, press F1.