Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Thespikedballofdoom/569c3516ad83b008d4204ba7140b9751 to your computer and use it in GitHub Desktop.
Save Thespikedballofdoom/569c3516ad83b008d4204ba7140b9751 to your computer and use it in GitHub Desktop.
Lua script for logitech gaming software to emulate F21 exclusively on the M3 profile
--Purpose: Rebind Logitech g3 on the M3 keyboard profile (of the current LGS profile) to F21.
--I use this key to toggle shadowplay recording without leaving triggers prone somewhere on my regular keyboard keys.
--Shadowplay is stupid and normally demands modifier keys but not for F keys.
--To use it, go in Logitech Gaming Software and right click your keyboard profile (the gear at the top) and edit script.
--Paste this in, save it and close.
--This executes in addition to whatever you bind on that key, so I reccommend leaving G3 on M3 blank!
--Read all about it at: C:/Program Files/Logitech Gaming Software/Resources/doc/G-seriesLuaAPI.pdf
--Or https://gist.github.com/Thespikedballofdoom/569c3516ad83b008d4204ba7140b9751
keymap = {
-- [1]="f13",
-- [2]="f14",
[3]="f21",
-- [4]="f16",
-- [5]="f17",
-- [6]="f18",
}
function OnEvent(event, gkey, family)
mkey = GetMKeyState()
if mkey == 3 then
key = keymap[gkey]
if event == "G_PRESSED" then
PressKey(key)
end
if event == "G_RELEASED" then
ReleaseKey(key)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment