diff options
author | Douglas Schilling Landgraf <dougsland@redhat.com> | 2009-06-11 11:19:33 -0300 |
---|---|---|
committer | Douglas Schilling Landgraf <dougsland@redhat.com> | 2009-06-11 11:19:33 -0300 |
commit | f554e1de646717a1ccbdb6af28fc936c1f80af46 (patch) | |
tree | 7d1254b68eb515deb572f1dc8646b5281daee845 | |
parent | ac6085626ffae1908cb5c07d90bf7fcfed25c5f9 (diff) | |
download | mediapointer-dvb-s2-f554e1de646717a1ccbdb6af28fc936c1f80af46.tar.gz mediapointer-dvb-s2-f554e1de646717a1ccbdb6af28fc936c1f80af46.tar.bz2 |
v4l: generate KEY_CAMERA instead of BTN_0 key events on input devices
From: Lennart Poettering <mzxreary@0pointer.de>
A bunch of V4L drivers generate BTN_0 instead of KEY_CAMERA key presses.
X11 is able to handle KEY_CAMERA automatically these days while BTN_0 is
not treated at all. Thus it would be of big benefit if the camera drivers
would consistently generate KEY_CAMERA. Some drivers (uvc) already do,
this patch updates the remaining drivers to do the same.
I only possess a limited set of webcams, so this isn't tested with all
cameras. The patch is rather trivial and compile tested, so I'd say it's
still good enough to get merged.
Priority: normal
Signed-off-by: Lennart Poettering <mzxreary@0pointer.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
-rw-r--r-- | linux/drivers/media/video/pwc/pwc-if.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/usbvideo/konicawc.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/usbvideo/quickcam_messenger.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/linux/drivers/media/video/pwc/pwc-if.c b/linux/drivers/media/video/pwc/pwc-if.c index b3765e280..eaeea5520 100644 --- a/linux/drivers/media/video/pwc/pwc-if.c +++ b/linux/drivers/media/video/pwc/pwc-if.c @@ -605,7 +605,7 @@ static void pwc_snapshot_button(struct pwc_device *pdev, int down) #ifdef CONFIG_USB_PWC_INPUT_EVDEV if (pdev->button_dev) { - input_report_key(pdev->button_dev, BTN_0, down); + input_report_key(pdev->button_dev, KEY_CAMERA, down); input_sync(pdev->button_dev); } #endif @@ -1859,7 +1859,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id pdev->button_dev->cdev.dev = &pdev->udev->dev; #endif pdev->button_dev->evbit[0] = BIT_MASK(EV_KEY); - pdev->button_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0); + pdev->button_dev->keybit[BIT_WORD(KEY_CAMERA)] = BIT_MASK(KEY_CAMERA); rc = input_register_device(pdev->button_dev); if (rc) { diff --git a/linux/drivers/media/video/usbvideo/konicawc.c b/linux/drivers/media/video/usbvideo/konicawc.c index 75485168e..07bc85761 100644 --- a/linux/drivers/media/video/usbvideo/konicawc.c +++ b/linux/drivers/media/video/usbvideo/konicawc.c @@ -249,7 +249,7 @@ static void konicawc_register_input(struct konicawc *cam, struct usb_device *dev #endif input_dev->evbit[0] = BIT_MASK(EV_KEY); - input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0); + input_dev->keybit[BIT_WORD(KEY_CAMERA)] = BIT_MASK(KEY_CAMERA); error = input_register_device(cam->input); if (error) { @@ -272,7 +272,7 @@ static void konicawc_unregister_input(struct konicawc *cam) static void konicawc_report_buttonstat(struct konicawc *cam) { if (cam->input) { - input_report_key(cam->input, BTN_0, cam->buttonsts); + input_report_key(cam->input, KEY_CAMERA, cam->buttonsts); input_sync(cam->input); } } diff --git a/linux/drivers/media/video/usbvideo/quickcam_messenger.c b/linux/drivers/media/video/usbvideo/quickcam_messenger.c index f129bea11..ab30ef54a 100644 --- a/linux/drivers/media/video/usbvideo/quickcam_messenger.c +++ b/linux/drivers/media/video/usbvideo/quickcam_messenger.c @@ -112,7 +112,7 @@ static void qcm_register_input(struct qcm *cam, struct usb_device *dev) #endif input_dev->evbit[0] = BIT_MASK(EV_KEY); - input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0); + input_dev->keybit[BIT_WORD(KEY_CAMERA)] = BIT_MASK(KEY_CAMERA); error = input_register_device(cam->input); if (error) { @@ -135,7 +135,7 @@ static void qcm_unregister_input(struct qcm *cam) static void qcm_report_buttonstat(struct qcm *cam) { if (cam->input) { - input_report_key(cam->input, BTN_0, cam->button_sts); + input_report_key(cam->input, KEY_CAMERA, cam->button_sts); input_sync(cam->input); } } |