Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3c684c8cd4d1a81004daa21f7ad3dad5119916e3
Commit:     3c684c8cd4d1a81004daa21f7ad3dad5119916e3
Parent:     91525300baf162e83e923b09ca286f9205e21522
Author:     Jan Kiszka <[EMAIL PROTECTED]>
AuthorDate: Wed Oct 24 16:24:22 2007 +0200
Committer:  Jiri Kosina <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:51:19 2008 +0100

    HID: Map MS Presenter 8000 bottom-side buttons
    
    The MS Presenter 8000 bluetooth mouse is a "dual-use" device: If you
    press a button on the top, you can turn it around and find special keys
    on the other side, useful for presentations. This patch maps those three
    bottom-keys that are not already detected to the intended functions. The
    magic bottom on the top is mapped to F5 when we switch from mouse to
    presenter mode in order to activate the presentation mode in the related
    software (e.g. OpenOffice).
    
    Signed-off-by: Jan Kiszka <[EMAIL PROTECTED]>
    Signed-off-by: Jiri Kosina <[EMAIL PROTECTED]>
---
 drivers/hid/hid-input.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 0b27da7..3a18ec4 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -89,6 +89,7 @@ static const struct {
 /* hardware needing special handling due to colliding MSVENDOR page usages */
 #define IS_CHICONY_TACTICAL_PAD(x) (x->vendor == 0x04f2 && device->product == 
0x0418)
 #define IS_MS_KB(x) (x->vendor == 0x045e && (x->product == 0x00db || 
x->product == 0x00f9))
+#define IS_MS_PRESENTER_8000(x) (x->vendor == 0x045e && x->product == 0x0713)
 
 #ifdef CONFIG_USB_HIDINPUT_POWERBOOK
 
@@ -780,9 +781,20 @@ static void hidinput_configure_usage(struct hid_input 
*hidinput, struct hid_fiel
                                                set_bit(KEY_F18, input->keybit);
                                        default:        goto ignore;
                                }
-                       } else {
+
+                       /* Microsoft Wireless Notebook Presenter Mouse 8000 */
+                       } else if (IS_MS_PRESENTER_8000(device)) {
+                               set_bit(EV_REP, input->evbit);
+                               switch(usage->hid & HID_USAGE) {
+                                       /* Useful mappings of bottom-side keys 
for presentations */
+                                       case 0xfd08: map_key_clear(KEY_RIGHT);  
        break;
+                                       case 0xfd09: map_key_clear(KEY_LEFT);   
        break;
+                                       case 0xfd0b: map_key_clear(KEY_PAUSE);  
        break;
+                                       case 0xfd0f: map_key_clear(KEY_F5);     
        break;
+                                       default:    goto ignore;
+                               }
+                       } else
                                goto ignore;
-                       }
                        break;
 
                case HID_UP_CUSTOM: /* Reported on Logitech and Powerbook USB 
keyboards */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to