[Pommed-commits] r377 - in trunk: . pommed
jblache at alioth.debian.org
jblache at alioth.debian.org
Fri Nov 16 18:44:29 UTC 2007
Author: jblache
Date: 2007-11-16 18:44:29 +0000 (Fri, 16 Nov 2007)
New Revision: 377
Modified:
trunk/ChangeLog
trunk/pommed/evdev.c
trunk/pommed/evdev.h
Log:
Add support for the external Apple USB keyboards, white & alu. Patch from Carmine 'earcar' Paolino <earcar at gmail.com>.
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-11-16 18:31:15 UTC (rev 376)
+++ trunk/ChangeLog 2007-11-16 18:44:29 UTC (rev 377)
@@ -11,6 +11,9 @@
polling instead of poll(). Use inotify to watch new event devices
appear in /dev/input. This effectively fixes our disappearing
event devices issues after suspend. YAY.
+ - pommed: add support for the external Apple USB keyboards, white
+ & alu. If you have such a keyboard with another USB ID, please
+ contact me. Patch from Carmine 'earcar' Paolino <earcar at gmail.com>.
version 1.10:
- pommed: add a beeper feature as a substitute to the missing PC
Modified: trunk/pommed/evdev.c
===================================================================
--- trunk/pommed/evdev.c 2007-11-16 18:31:15 UTC (rev 376)
+++ trunk/pommed/evdev.c 2007-11-16 18:44:29 UTC (rev 377)
@@ -626,6 +626,31 @@
}
#endif /* !__powerpc__ */
+/* External Apple USB keyboards */
+int
+evdev_is_extkbd(unsigned short *id)
+{
+ unsigned short product = id[ID_PRODUCT];
+
+ if (id[ID_BUS] != BUS_USB)
+ return 0;
+
+ if (id[ID_VENDOR] != USB_VENDOR_ID_APPLE)
+ return 0;
+
+ if ((product == USB_PRODUCT_ID_APPLE_EXTKBD_WHITE)
+ || (product == USB_PRODUCT_ID_APPLE_EXTKBD_ALU))
+ {
+ logdebug(" -> External Apple USB keyboard\n");
+
+ kbd_set_fnmode();
+
+ return 1;
+ }
+
+ return 0;
+}
+
/* Mouseemu virtual keyboard */
static int
evdev_is_mouseemu(unsigned short *id)
@@ -670,7 +695,8 @@
&& !(appleir_cfg.enabled && evdev_is_appleir(id))
#endif
&& !(has_kbd_backlight() && evdev_is_lidswitch(id))
- && !(evdev_is_mouseemu(id)))
+ && !(evdev_is_mouseemu(id))
+ && !(evdev_is_extkbd(id)))
{
logdebug("Discarding evdev: bus 0x%04x, vid 0x%04x, pid 0x%04x\n", id[ID_BUS], id[ID_VENDOR], id[ID_PRODUCT]);
Modified: trunk/pommed/evdev.h
===================================================================
--- trunk/pommed/evdev.h 2007-11-16 18:31:15 UTC (rev 376)
+++ trunk/pommed/evdev.h 2007-11-16 18:44:29 UTC (rev 377)
@@ -43,6 +43,10 @@
#define USB_PRODUCT_ID_GEYSER4HF_ISO 0x022a
#define USB_PRODUCT_ID_GEYSER4HF_JIS 0x022b
+/* Apple USB keyboards, external */
+#define USB_PRODUCT_ID_APPLE_EXTKBD_WHITE 0x020c
+#define USB_PRODUCT_ID_APPLE_EXTKBD_ALU 0x0221
+
/* Apple Remote IR Receiver */
#define USB_PRODUCT_ID_APPLEIR 0x8240
#define USB_PRODUCT_ID_APPLEIR_2 0x8242
More information about the Pommed-commits
mailing list