title: Listen for Function Keys in Logitech G Lua Script
body: <p>I have a Logtech G915 TKL keyboard, and it has programmable function keys. You can write scripts that listen for special keys on Logitech G hardware (such as the G Keys or the M Keys) using the scripting feature in Logitech G Hub.</p>
  <p>I would like to write a script that listens for when I press the F1 key and does some action. Here's my attempt:</p>
  <pre class="lang-lua prettyprint-override"><code>function OnEvent(event, arg)
      --Listen for F1 (G10) key press event
      if (event == &quot;G_PRESSED&quot; and arg == 10) then
          --Do some action (e.g. press the &quot;a&quot; key)
          PressAndReleaseKey(30);
          SLeep(50);
      end
  end
  </code></pre>
  <p>My attempt was based off the assumption that Logitech might consider the F1-12 keys to be additional G keys. My mouse has 9 G keys, so I guessed that F1 might be G10.</p>
  <p>Does anyone have any ideas? Thank you for your time!</p>