View Single Post
Posts: 355 | Thanked: 598 times | Joined on Sep 2009 @ Nizhny Novgorod, Russia
#129
Here is my simple C program which parses /dev/input/jack output: http://pastie.org/8330979

You will need to look into <linux/input.h> to see which constants might be used for headphone buttons. This program tests only SW_LINEOUT_INSERT and SW_VIDEOOUT_INSERT.

Note that input_event32 struct defined in this code is a copy of input_event defined in <linux/input.h>. I've redefined it here because the size input_event is different on 64-bit host than on 32-bit phone.
 

The Following 2 Users Say Thank You to Mitrandir For This Useful Post: