Skip to content

Instantly share code, notes, and snippets.

@Corgi
Forked from PseudoDoctor/default.lua
Created January 1, 2023 20:00
Show Gist options
  • Select an option

  • Save Corgi/8500184af93f24f476c4d607798070c4 to your computer and use it in GitHub Desktop.

Select an option

Save Corgi/8500184af93f24f476c4d607798070c4 to your computer and use it in GitHub Desktop.

Revisions

  1. @PseudoDoctor PseudoDoctor revised this gist Feb 11, 2021. 2 changed files with 6 additions and 2 deletions.
    2 changes: 2 additions & 0 deletions default.lua
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    function OnEvent(event, arg , kb)
    end
    6 changes: 4 additions & 2 deletions logitech-bind-f13-f24.lua
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,10 @@
    -- How to use this script:
    -- 1. Install the Logitech Gaming Software: http://support.logitech.com/en_us/software/lgs
    -- 2. Launch it, and click on the small arrow on the profile (Default uses gear icon) and then click on "Scripting".
    -- 3. Add the following code into the Script window, save it, and close it. Enjoy.
    -- For older G15, the uncommented code makes G13 bound to F13, G4 to G14, ... G18 to F18.
    -- 3. Add the following code into the Script window, save it, and close it.
    -- 4. Unassign the keys in the GUI otherwise both the binding below as well as the GUI assignment will be sent.
    -- Now G13 is bound to F13, G14 to G14, ... G18 to F18.
    -- 5. If you'd like to use the GUI instead, now it's easy to create a "Command" with F13-F18

    function OnEvent(event, arg)

  2. @PseudoDoctor PseudoDoctor revised this gist Feb 11, 2021. 1 changed file with 22 additions and 14 deletions.
    36 changes: 22 additions & 14 deletions logitech-bind-f13-f24.lua
    Original file line number Diff line number Diff line change
    @@ -1,26 +1,34 @@
    -- 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".
    -- 2. Launch it, and click on the small arrow on the profile (Default uses gear icon) and then click on "Scripting".
    -- 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.
    -- For older G15, the uncommented code makes G13 bound to F13, G4 to G14, ... G18 to F18.

    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
    -- Older G15 keyboard, G13->F13
    [13] = 0x64, -- F13
    [14] = 0x65, -- F14
    [15] = 0x66, -- F15
    [16] = 0x67, -- F16
    [17] = 0x68, -- F17
    [18] = 0x69, -- F18
    -- Newer keyboards, G1->F13
    -- [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
  3. @ewauq ewauq revised this gist Oct 22, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion logitech-bind-f13-f24.lua
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,8 @@
    -- 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"
    -- 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)

  4. @ewauq ewauq revised this gist Oct 22, 2017. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion logitech-bind-f13-f24.lua
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,11 @@
    -- 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.

    function OnEvent(event, arg)

    OutputLogMessage("event = %s, arg = %s\n", event, arg)
    -- OutputLogMessage("event = %s, arg = %s\n", event, arg)

    fKey = {
    [1] = 0x64, -- F13
  5. @ewauq ewauq revised this gist Oct 22, 2017. No changes.
  6. @ewauq ewauq revised this gist Oct 22, 2017. No changes.
  7. @ewauq ewauq created this gist Oct 22, 2017.
    28 changes: 28 additions & 0 deletions logitech-bind-f13-f24.lua
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    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