3

I have implemented a check for G-Keys being pressed in a Windows Forms Application (C#) using the Logitech G-Key Macro SDK. Specifically using a wrapper class and the supplied LogitechGkeyEnginesWrapper.dll exactly as it suggests in the documentation (included in the SDK).

This works perfectly when my application has focus, and when any child windows have focus. I can check via a callback or an update call (as suggested in the docs) but neither work when my application does not have focus.

I am hoping to capture this input (of the G-Keys only) outside of application focus (global). I do not believe these keys send a scan code and the G-Key Macro SDK is required to get the state of this keyboard/mouse key.

Any help would be greatly appreciated. I have sent an email to Logitech Dev Support regarding this, but have not received anything back at this time.

Link to Logitech Developers page: http://gaming.logitech.com/en-au/developers

aaronedmistone
  • 929
  • 10
  • 17
  • Please see: https://stackoverflow.com/questions/3312752/capturing-mouse-keyboard-events-outside-of-form-app-running-in-background – Bender Bending Jul 03 '17 at 20:26
  • Thank you, but this isn't a normal keyboard key. It doesn't send a scan code and cannot be captured this way (IIRC). – aaronedmistone Mar 11 '18 at 21:16
  • A workaround for this, is to add your application .exe to the gaming profile in the Logitech Gaming software. Eg if you want to give your software access to the G-keys while playing Satisfactory, add your programs exe file to the satisfactory profile. Your program will now get keydown events for G-keys while Satisfactory has focus. – user3734274 May 25 '22 at 18:08

1 Answers1

4

After contacting Logitech G Developer support, they responded with the following:

You are correct in that the G-keys do not function when the application loses focus. There is currently no way around this, as our design rationale is that a third-party application should not be able to read the keystrokes of the current app in question.

So the scope of G-keys data is, by design, tied to the application in focus.

aaronedmistone
  • 929
  • 10
  • 17