Quote:
Originally Posted by PoP
I always wanted to be able to detect the jack. How? On my K3 cat /dev/input/event0 shows the keyboard cat /dev/input/event1 shows the fiveway cat /dev/input/event2 shows the volume but none of these events show insertion or removal ot the headphone jack.
And waitforkey just sits waiting as you plug in and out the jack. Different version? Bad doc?
Code:
[root@kindle root]# ls -all /usr/bin/waitforkey
-rwxr-xr-x 1 root root 4604 Jul 31 2010 /usr/bin/waitforkey
[root@kindle root]# cat /usr/bin/waitforkey | md5sum
3d0e60680eba05a8f88667eb31b7c197 -
[root@kindle root]#
|
Does waitforkey return a keycode for headphone events on your K3?
Because waitforkey does WAIT for an event, I ran it in a background loop and piped its output to a temp file. Then a foreground script could periodically check that file to see if any new keycodes had been generated.
Firmware 5.0.x also returned rotation events for waitforkey. Perhaps 5.1.0 removed headphone events too, when they removed accelerometer events.
UPDATE: I just tested this from K5 diags SSH, and waitforkey DOES return headphone keycodes (insert=60 remove=59). It is not reliably seeing all events though (but my headphone jack seems "loose and sloppy" so maybe the switch is not working right). I used to test my scripts in diags because it has a lot more free ram than main with cvm and Xorg running.