0

I'm trying to detect when the snapshot button of my USB camera is pushed.

Here are the infos I gathered about my camera with cat /proc/bus/input/devices:

I: Bus=0003 Vendor=0c45 Product=6353 Version=0150
N: Name="USB Microscope"
P: Phys=usb-3f980000.usb-1.3/button
S: Sysfs=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/input/input14
U: Uniq=
H: Handlers=kbd event0
B: PROP=0
B: EV=3
B: KEY=100000 0 0 0 0 0 0

No documentation nor identification is available about my specific model, as usual :)

I tried to listen /dev/input/event0 with cat /dev/input/event0, but, unlike mice or keyboards, i didn't see any result. I also tried to listen this handler with python module evdev, without success ...

Did someone has a clue about this case ?

1

If clearly says input14 (in the configuration after that particular boot, numberings can change), so of course looking at event0 won't show anything.

1) Run evtest as root, see if you can figure out which device it is by looking at the description, and listen to it (my USB webcam produces KEY_CAMERA).

2) Run xev, move cursor into window, see if the event shows up (my USB webcam produces XF86WebCam).

3) You may need to activate your camera with luvcview or a similar program to make it produce events.

4) If you decide to use the input-layer interface, have a look at /dev/input/by-id, and if there's no entry, at /dev/input/by-path for symlinks to the event* devices that are guaranteed to be constant accross boots.

  • Wonderful, excellent, perfect ! both solution 1) and 4) are working out of the box, and now I understand better how events are linked. Thank you :) – Technico.top Oct 20 '17 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.