-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General question: How to get G keys and M keys working #39
Comments
At this time, I don't have idea how work G and M keys. |
There's a kernel module for the G710+ keyboard. https://github.com/Wattos/logitech-g710-linux-driver It's the only thing I could find which is even remotely related to the G910. |
If possible, report to later... |
Sorry. I was busy the last couple of weeks. I made some Wireshark dumps of the M-Keys. Please let me know if this helps. You have to filter to 3.2.0. I don't know if it's possible save with this filter already enabled. Filenames are like that. M1-LEDisOff-press.pcapng is a dump of pressing the M1 key while the LED on the key is not on. The LED switches between the M keys. The concept behind this is. That you can press MR (MR lights up) press a G-key (MR starts flashing), press any other key to set this G key to the this key and press MR again to save (MR turns off) |
BTW: is there any documentation for these protocols? I'd really like to get the M keys and G keys to work properly. But it's difficult for me to find the right place to start understanding the protocol. |
I just looked the dumps but I don't see anything, it's not the same format as my dumps...
Sorry, It's retro engineer... |
No the M keys don't have a RGB led. It's orange for M1-3 and red for MR The G910 seems to create three devices. 0 Sends key events for G and M keys. But these are not recognized by the Linux kernel. By default all G keys are mapped to the F keys (G1 -> F1, ...). The Logitech Gaming Software sends some kind of initialization to the keyboard to disable these mapped keycodes, interprets the special key events on the 0 device and translates them for Windows. |
hi, |
@frostworx Look the TODO : https://github.com/MatMoul/g810-led/blob/master/TODO.md |
hi MatMoul, I see. thank you for the quick reply! |
hi, me again. new upload - sorry for the noise (again) :} |
I just looked the dump, it can help me but the best is to make a dump when you set your g keys configuration. |
I'm not sure if I mentioned this already. But it's acutally the Logitech daemon which handles the key events. If you kill the LGS with the taskmanager the G keys do no longer work. I suspect it sends some kind of initialization to the keyboard to disable the default behaviour (Gx -> Fx) and that's it. There are special key events for the G keys, but Linux doesn't recognize them on its own. So after we figured out how to disable the default behaviour I can try to build a daemon which redirects the unknown key events to known ones. e.g. F13-F21 |
hi, |
hi CReimer (OT: afair I know your avatar from some german vdr threads, but I wasn't very active there, so I might be wrong. for whatever reason I even remember a nickname, but do not call it here, it is not "CReimer" :} - EDIT: googled the nick I rembembered and I was right indeed :}). |
You are right. I'm also active with the same avatar as "Copperhead" |
hehe, I'm really surprised, why I remembered that, as my last comment was in 2012. |
OK. Here's another dump. This time with Arch Linux and Windows 10 in a VirtualBox. This dump starts with an already running LGS inside the VBox and a device link in Vbox shortly afterwards. This dump should cover the whole initialization process for the G910 |
OK. I tried to find my way through these dumps. It's difficult, because I really don't get how these keyboards communicate. Could you at least try to write a few informations down somewhere to help a newcomer to figure this out? Thanks. |
Look at /wireshark_dumps/g810-spectrum/set_keys_colors.pcapng |
OK. I'm getting there. 11ff091e01000000000000000000000000000000 #M1 |
Very interresting... |
Can you try the mkeys branch ? |
And here are a few more. 11ff082e01 #Disable mapping of G1-9 to F1-9 Your branch is working btw. But wouldn't it be better to set them as they actually are. The hex value seems to be a reversed three-digit binary number. 0 --> 000 | M3 off | M2 off | M1 off |
@CReimer Thank you for your return, |
The m key leds don't need a commit and neither does the G->F mapping And as argument something like: --gkey-fkey-mapping Enable or disable the internal mapping of G1-9 to F1-9 |
--gkey-fkey-mapping can be used if the command is persistant after a shutdown... |
Sounds good to me. I wasn't aware that you only use the double hyphen arguments for persistent settings. |
Can you try the last pushed version with -mr or -mn, I have removed the commit. |
All three commands work perfectly. |
Thank for your work... |
Add wireshark dump which helped fix #39
Just a little follow up. https://github.com/CReimer/g910-gkey-uinput It's nice and small but I would prefer to tell the kernel somehow about these keys. So if anyone finds some information about that. Please let me know. |
Good work for you g910-gkey-uinput... https://github.com/Wattos/logitech-g710-linux-driver seem the best way to start a driver... I'm also interested to make a driver but It's more hard to debug... |
thank you both for your good work! unfortunately I do have too many open projects atm to make something useful with the new build. disabling the G keys works fine. Not sure if I get you right, but as this happens in userspace I wonder how a kernel module should remap the unmapped keys afterwards. wouldn't the kernel code depend on the userspace program then? |
Hey, I would also like to thank @MatMoul for his great controller and everyone here. Your information really helped me. |
@CReimer I'm trying to get M and G keys working on my G815, and I can't seem to find the code to unmap the G keys from the F keys. Are you able to explain what you did while recording to capture that? |
I'm actually Not Sure how exactly I did it (this was 3 years ago). But my uinput Script relies in the g810-led tool. I found this issue #39 with all infos on how we figured it out |
@CReimer #39 is the issue I contacted you from :) I have tried sending everything the windows software sends on startup to the USB, using this test script: https://gist.github.com/cornernote/805de3ae9d50922e1769ef78296da60d Nothing seems to enable the G-Keys :( I basically got the wireshark dump, extracted everything from the startup before the colour settings, then ran that in a python script. Is that how you found it? |
Oops
I hacked it into @MatMoul's g810-led. But yes. That's more or less how I figured it out. The first thing you need to figure out is how to disable the default mapping. I don't expect it to be much different (if at all) from the G910 keyboard. You need g810-led up and running with the -gkm 1 parameter. This disables the Gx --> Fx mapping. From now on the G-keys send their own keycodes. To make these known to the system, you need the g910-gkey-uinput Python script. As far as I remember I often watched the wrong device with Wireshark. To work around N-Key-Rollover issues there are two keyboard devices. And the special keys M and G are only available on the second device |
@CReimer I found the code to enable the G-Keys! I have documented everything here: It's also worth linking to the issue for the G815 keyboard - #188 I plan on adding G815 support to sidewinderd for full G-Key support - tolga9009/sidewinderd#40 |
Is there some Linux tool to make the M and G keys work as they do in Windows or at least something to give them unique events?
The text was updated successfully, but these errors were encountered: