summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-libs/libg15/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-libs/libg15/files')
-rw-r--r--dev-libs/libg15/files/g15tools.patch100
1 files changed, 100 insertions, 0 deletions
diff --git a/dev-libs/libg15/files/g15tools.patch b/dev-libs/libg15/files/g15tools.patch
new file mode 100644
index 00000000000..960d3fea29d
--- /dev/null
+++ b/dev-libs/libg15/files/g15tools.patch
@@ -0,0 +1,100 @@
+Patch from upstream bug tracker:
+http://sourceforge.net/tracker/?func=detail&aid=3336448&group_id=167869&atid=844658
+
+As only part of G510 support was merged to upstream. Does NOT apply & compile
+on top of 1.2.7-r1.
+
+diff -aNru trunk/libg15/libg15.c mod/libg15/libg15.c
+--- trunk/libg15/libg15.c 2011-03-31 23:33:44.000000000 +0000
++++ mod/libg15/libg15.c 2011-06-26 07:08:21.000000000 +0000
+@@ -1029,6 +1029,76 @@
+ }
+ }
+
++// Logitech G510 Media Keys implementation. Unknown if this will work for other
++// models. Using the backlight key as a modifier. The assumption is you would
++// normally not be holding down the backlight key while pressing G-keys.
++static void processKeyEvent2Byte(unsigned int *pressed_keys, unsigned char *buffer)
++{
++ // Key modifier
++ *pressed_keys |= G15_KEY_LIGHT;
++
++ // XF86AudioPlay
++ if (*pressed_keys & G15_KEY_G1)
++ *pressed_keys -= G15_KEY_G1;
++
++ // XF86AudioStop
++ if (*pressed_keys & G15_KEY_G2)
++ *pressed_keys -= G15_KEY_G2;
++
++ // XF86AudioPrev
++ if (*pressed_keys & G15_KEY_G3)
++ *pressed_keys -= G15_KEY_G3;
++
++ // XF86AudioNext
++ if (*pressed_keys & G15_KEY_G4)
++ *pressed_keys -= G15_KEY_G4;
++
++ // XF86AudioMute
++ if (*pressed_keys & G15_KEY_G5)
++ *pressed_keys -= G15_KEY_G5;
++
++ // XF86AudioRaiseVolume
++ if (*pressed_keys & G15_KEY_G6)
++ *pressed_keys -= G15_KEY_G6;
++
++ // XF86AudioLowerVolume
++ if (*pressed_keys & G15_KEY_G7)
++ *pressed_keys -= G15_KEY_G7;
++
++ g15_log(stderr,G15_LOG_WARN,"Keyboard: %x, %x\n", buffer[0], buffer[1]);
++
++ if (buffer[0] == 0x02)
++ {
++ // XF86AudioPlay
++ if (buffer[1] & 0x08)
++ *pressed_keys |= G15_KEY_G1;
++
++ // XF86AudioStop
++ if (buffer[1] & 0x04)
++ *pressed_keys |= G15_KEY_G2;
++
++ // XF86AudioPrev
++ if (buffer[1] & 0x02)
++ *pressed_keys |= G15_KEY_G3;
++
++ // XF86AudioNext
++ if (buffer[1] & 0x01)
++ *pressed_keys |= G15_KEY_G4;
++
++ // XF86AudioMute
++ if (buffer[1] & 0x16)
++ *pressed_keys |= G15_KEY_G5;
++
++ // XF86AudioRaiseVolume
++ if (buffer[1] & 0x32)
++ *pressed_keys |= G15_KEY_G6;
++
++ // XF86AudioLowerVolume
++ if (buffer[1] & 0x64)
++ *pressed_keys |= G15_KEY_G7;
++ }
++}
++
+ int getPressedKeys(unsigned int *pressed_keys, unsigned int timeout)
+ {
+ unsigned char buffer[G15_KEY_READ_LENGTH];
+@@ -1063,6 +1133,13 @@
+ case 9:
+ processKeyEvent9Byte(pressed_keys, buffer);
+ return G15_NO_ERROR;
++ case 2:
++ if (g15DeviceCapabilities() & G15_DEVICE_G510)
++ {
++ processKeyEvent2Byte(pressed_keys, buffer);
++ return G15_NO_ERROR;
++ }
++ // Deliberate fallthrough
+ default:
+ return handle_usb_errors("Keyboard Read", ret); /* allow the app to deal with errors */
+ }