Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 07-15-2012, 03:42 AM   #1
inuxy
Junior Member
inuxy began at the beginning.
 
Posts: 8
Karma: 12
Join Date: Jul 2012
Device: kindle touch
Detecting headphone events on kindle touch

Where am I able to detect certain events on the kindle? I would like to make a script that listens for these events. One event I would be interested in is when a headphone jack is inserted.
inuxy is offline   Reply With Quote
Old 07-15-2012, 09:16 AM   #2
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by inuxy View Post
Where am I able to detect certain events on the kindle? I would like to make a script that listens for these events. One event I would be interested in is when a headphone jack is inserted.
The easiest way is to have your script call "waitforkey". To find all the keycode events, try causing events while this command is running in SSH:

while :;do waitforkey;done

It will show unique keycodes for headphone insertion and removal. On 5.0.x firmware (which booted up with the accelerometer enabled), waiforkey will even show keycodes for rotation events.
geekmaster is offline   Reply With Quote
Advert
Old 07-15-2012, 09:51 AM   #3
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Cross posted: https://www.mobileread.com/forums/sho...52#post2150952
PoP is offline   Reply With Quote
Old 07-15-2012, 10:16 AM   #4
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by PoP View Post
Headphone events only seem to generate waitforkey keycodes in K5 diags in the latest firmware update. Rotation events also return keycodes from K5 diags. That is where I tested my scripts in the past because diags has a lot more free RAM than main.

It appears that in main (K3 and K5), events like headphone insert/remove are not detected. It would be interesting to see if copying waitforkey from K5 diags to other bootmodes or devices would work.

I just copied the K5 diags waitforkey to /mnt/us, then I rebooted to main. From main, the diags waitforkey does not return headphone events, so it must depend on library or kernel support. Bummer...

Last edited by geekmaster; 07-15-2012 at 10:23 AM.
geekmaster is offline   Reply With Quote
Old 07-15-2012, 11:38 AM   #5
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Since it's now using X, anyone checked if X gets any of these events (via something like xev)?
NiLuJe is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
calibre isn't detecting new nook simple touch with glow light Tarry Devices 15 02-07-2017 11:33 AM
Free (Kindle) Reconstructing 3/11: Earthquake, Tsunami... [Japan Recent Events] ATDrake Deals and Resources (No Self-Promotion or Affiliate Links) 0 06-11-2012 03:54 PM
Touch uinput : send simulated touch/key events to Kobo ? Rom1 Kobo Reader 0 06-08-2012 08:50 AM
Touch screen events Ehhh Kindle Developer's Corner 3 05-16-2012 02:33 PM


All times are GMT -4. The time now is 02:16 AM.


MobileRead.com is a privately owned, operated and funded community.