I bought G110 which is the light version of the extra-ultra-super expensive G19.
It does not feature LCD screen.
Multimedia keys work out of the box.
However G keys produce the same scan code with the corresponding F keys (12 in total)
and M keys do not provide any IIRC.
I edited the libg15.c (or whatever) and entered the keyboard name, device and product id and features (only G keys)
but now the G keys do not provide ANY scan code.
Does anyone have a clue how to use the G keys?
I can donate a reasonable/humble amount of money to a responsible and experienced member of the forum in order to buy the keyboard.
I could also accept to install windows to find out info but I am not at all experienced reverse engineer.
(actually I am still doing my thesis for -forward- engineer :D:D:D )
tx
Stop trying to apply this patch
This patch has had vital information stripped from it when it got uploaded here on the site. A working patch is in the trackers on sf.net, and it's also in the git tree.
To check out your source from SVN (highly recommended), install svn (might be named subversion), and run
Navigate to g15tools/trunk/libg15/
then run make/turn it into a .deb/.rpm as usual.
made it works
you were correct to edit the libg15.c to identify the keyboard but you were missing some other changes to make in order to decode the keys.
the g110 produces 4 bytes codes instead of 5 or 9 for other logitech keyboards.
you have to modify the getPressedKeys method to handle a 4 bytes return value in his switch.
you also have to create a new function processKeyEvent4Byte to decode the keys.
simple as that!
hope this helps
Install G110 Keyboard for Linux
To alexlefebvre, Thank You for your comment...
Can you detail both the getPressedKeys method
& processKeyEvent4byte function?
I'm hoping for your actual source code...
Do I save that code as an executable, or
execute a "compile" -type command to execute?
It's been a Long Time ago programming for me,
but I can give it a try, if you say it is simple...
Thank You for your help, Joseph
JosephBus@gmail.com
Excellent!
Sounds awesome. Can you provide a patch? I have a G19 available to me and it would be interesting to see if they share the same keycodes.
g110 patch
hi,
here is the g110 patch. As you said you have a G19 so you will have to add it to the device list at the top of the file so it is recognized.
--- libg15-1.2.7/libg15.c 2008-11-11 08:51:26.000000000 -0500
+++ new libg15-1.2.7/libg15.c 2010-03-16 07:23:27.174737274 -0400
@@ -44,6 +44,7 @@
const libg15_devices_t g15_devices[] = {
DEVICE("Logitech G15",0x46d,0xc222,G15_LCD|G15_KEYS),
DEVICE("Logitech G11",0x46d,0xc225,G15_KEYS),
+ DEVICE("Logitech G110",0x46d,0xc22b,G15_KEYS),
DEVICE("Logitech Z-10",0x46d,0x0a07,G15_LCD|G15_KEYS|G15_DEVICE_IS_SHARED),
DEVICE("Logitech G15 v2",0x46d,0xc227,G15_LCD|G15_KEYS|G15_DEVICE_5BYTE_RETURN),
DEVICE("Logitech Gamepanel",0x46d,0xc251,G15_LCD|G15_KEYS|G15_DEVICE_IS_SHARED),
@@ -762,6 +763,69 @@
}
}
+static void processKeyEvent4Byte(unsigned int *pressed_keys, unsigned char *buffer)
+{
+ int i;
+
+ *pressed_keys = 0;
+
+ g15_log(stderr,G15_LOG_WARN,"Keyboard: %x, %x, %x, %x\n",buffer[0],buffer[1],buffer[2],buffer[3]);
+
+ if (buffer[0] == 0x02)
+ {
+ if (buffer[1]&0x01)
+ *pressed_keys |= G15_KEY_G1;
+
+ if (buffer[1]&0x02)
+ *pressed_keys |= G15_KEY_G2;
+
+ if (buffer[1]&0x04)
+ *pressed_keys |= G15_KEY_G3;
+
+ if (buffer[1]&0x08)
+ *pressed_keys |= G15_KEY_G4;
+
+ if (buffer[1]&0x10)
+ *pressed_keys |= G15_KEY_G5;
+
+ if (buffer[1]&0x20)
+ *pressed_keys |= G15_KEY_G6;
+
+ if (buffer[1]&0x40)
+ *pressed_keys |= G15_KEY_G7;
+
+ if (buffer[1]&0x80)
+ *pressed_keys |= G15_KEY_G8;
+
+ if (buffer[2]&0x01)
+ *pressed_keys |= G15_KEY_G9;
+
+ if (buffer[2]&0x02)
+ *pressed_keys |= G15_KEY_G10;
+
+ if (buffer[2]&0x04)
+ *pressed_keys |= G15_KEY_G11;
+
+ if (buffer[2]&0x08)
+ *pressed_keys |= G15_KEY_G12;
+
+ if (buffer[2]&0x10)
+ *pressed_keys |= G15_KEY_M1;
+
+ if (buffer[2]&0x20)
+ *pressed_keys |= G15_KEY_M2;
+
+ if (buffer[2]&0x40)
+ *pressed_keys |= G15_KEY_M3;
+
+ if (buffer[2]&0x80)
+ *pressed_keys |= G15_KEY_MR;
+
+ if (buffer[3]&0x1)
+ *pressed_keys |= G15_KEY_LIGHT;
+
+ }
+}
int getPressedKeys(unsigned int *pressed_keys, unsigned int timeout)
{
@@ -780,6 +844,9 @@
}
switch(ret) {
+ case 4:
+ processKeyEvent4Byte(pressed_keys, buffer);
+ return G15_NO_ERROR;
case 5:
processKeyEvent5Byte(pressed_keys, buffer);
return G15_NO_ERROR;
About that G110 Patch...
Thank You Alex, I'm trying to try it, but alas, need a little more definition if you've got the time...
I'm using Ubuntu 10.04, my understanding that the patch code is something
like...
Code:
---------------------------
apt-get install patch
patch -p0 < patchfile
--------------------------
where "patchfile" is your source?
how is "p0" defined?
Anything else I need?...Thx, Joseph@gmail.com
Newbie
I'm a newbie to Linux, so I need a step by step instructions on how to apply this patch. To quote Denzel Washington from Philadelphia: "Now, explain it to me like I'm a four-year-old."
Thanks :D
~Nybras
patch doesn't work
I manually copy pasted the new code (as patch utility failed, probably different version), it compiled ok, but the G and M keys are not recognized by xev. Any ideas?
Try running libg15 with
Try running libg15 with maximum debuglevel and see if it registers the keypresses. Also g15daemon too and see if it has anything interresting. If those fail you might want to dig deeper and look what the kernel sees.
I do not really know how to do all this, but there's been people doing similar somewhere here on the forums (rolleyes), might have some luck there..
Also do you know if the G110 has It's own processor in it like the G19 (which runs linux AFAIK)? Or did they strip that out together with the LCD?
I'm attempting this as well with the G19.
Despite having it's own CPU, the G19 doesn't appear to have a lot of 'intelligence' inside it - the screen appears to be updated as raw 16-bit data on every frame (ie there's nothing 'running' on the keyboard to maintain the screen), and the M1-M3, MR backlights are just set using a bitmask.
However, it seems to actually upload the macro profile to the keyboard on connection, which would explain what the CPU's for (like the Razer), in which case that would mean the G keys would have to be configured over USB, rather than just being able to grab their IDs from a driver. According to Logitech's website, the G110 has;
"Onboard memory
It saves your profiles so you can take your personal preferences with you."
Which would suggest the same thing.