Controlling Logitech M keys?

Ask gaming related questions
User avatar
Scr1pter
Posts: 1200
Joined: 06 Aug 2017, 08:21
Location: Germany

Controlling Logitech M keys?

30 Dec 2017, 21:00

Hi guys,

I have a Logitech G15 keyboard which has 18 G keys and 3 M keys.
It is possible to read and change the status of the M keys
within the Logitech Gaming Software.
(E.g. by specifying that the G1 key changes them - or by pressing the M keys directly.)
However, I would like to be able to change them with other keys too.

I checked the AHK section "Special keys" and created a script which logs the pressed keys.
I simply created a script with

Code: Select all

key::
#InstallKeybdHook
#KeyHistory
When running the script and pressing the defined key,
the script window gets opened and I see the last 20 keys (for example).
There is nothing regarding the M keys, though.

And idea what to do?
Please use [code][/code] when posting code!
Keyboard: Logitech G15 FE - Mice: Logitech G9 FE, G502 FE, G602, Jelly Comb Touchpad - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.32.00
User avatar
Scr1pter
Posts: 1200
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Controlling Logitech M keys?

01 Jan 2018, 16:49

Hi,

I made some small progress by myself.
I tried it with ControlClick.
The Logitech Gaming Software must be opened (background is ok, but not minimized) and I must be in the keyboard menu.
Then it's possible that by pressing a specific key combination I can activate any M mode.

Code: Select all

^+!F5::
ControlClick, x509 y180, Logitech Gaming Software
return
Image
(Not my screenshot, but mine looks pretty similar.)

However, from all possible solutions this one might be the worst.
So I will be glad if anyone has a better idea.
I mean these G and M keys must send and receive specific signals.
If I can send these signals with AHK, everything will be great.

Thanks for any help!
Please use [code][/code] when posting code!
Keyboard: Logitech G15 FE - Mice: Logitech G9 FE, G502 FE, G602, Jelly Comb Touchpad - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.32.00
Noesis
Posts: 299
Joined: 26 Apr 2014, 07:57

Re: Controlling Logitech M keys?

02 Jan 2018, 01:38

Ok first up, I don't have one of these keyboards, so I'm not entirely sure what happens here, but from your description, when you click (or simulate one via controlclick) on the M key buttons in the above screen shot, it changes the keyboard mode (which presumably changes the G-Key functions on the left edge ?).

Assuming this is correct, is that change also persistent ? (i.e after closing LGS, does the mode stay at the new mode.)

Essentially, if the answers to both the above is yes, you have two options that I know of, if not the first should still work anyway.

First (and the easier method) is check out this thread https://autohotkey.com/boards/viewtopic.php?f=5&t=34400 which was about the same thing only attacking it from a different angle. The solution in the end was using LGS's lua scripting with a library you can download included to extend it's native features, to get the end result.

Second, assuming these clicks are persistant, you are correct in what you were thinking about "these G and M keys must send and receive specific signals. If I can send these signals with AHK, everything will be great.". The issue is finding the signals. In the thread I linked above I mentioned about a Razer device that I have and at that time I hadn't worked out how to do it but since then I have. The solution is likely the same only the signal or "message" will be different. Essentially you'll need to use something like "spyxx" or similar to monitor messages when you change the mode, and identify the correct one. You will also need to monitor the correct process (which is likely not the main config window, but one of the background hidden ones that is always running).

The second is definitely the more difficult of the two options, but it could probably be done this way, which would result in code using sendmessage or postmessage with the correct parameters to the correct "window". Personally, I'd go the first option.
User avatar
Scr1pter
Posts: 1200
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Controlling Logitech M keys?

02 Jan 2018, 05:49

Hi Noesis,

What you assume is correct.
It doesn't matter if you press the hardware key (M1 till M3) or the software button on the screenshot.
Once this was done, the change is persistent until a new signal (or condition) tells the Logitech software to change the M mode.

The thread you linked is indeed interesting.
Yesterday I made some tests by pressing the NumLock key.
Those Modifier gets analyzed by the Logitech Gaming Software, so you could kind of cheat it.
(E.g. press X times NumLock and raise a variable by 1, If variable = 2 then press M2.)
It worked, but was not really comfortable.

Fortunately I have some knowledge regarding lua, so I understood a lot of the stuff which is in the link.

P.S. Whoever moved the thread in the Gaming section: I disagree to that, because I'm not talking about any game + I use the keyboard and software for many "normal applications".
Please use [code][/code] when posting code!
Keyboard: Logitech G15 FE - Mice: Logitech G9 FE, G502 FE, G602, Jelly Comb Touchpad - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.32.00

Return to “Gaming”

Who is online

Users browsing this forum: Kolo and 16 guests