Register Guidelines E-Books Search Today's Posts Mark Forums Read

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
Всё гениальное просто.
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: 5,066
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
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
Old 07-15-2012, 09:51 AM   #3
PoP
why ≸ when =
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: 475
Karma: 4068311
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3.₄, PRS-350, SGS3, Rπ, iPad Air
Cross posted: http://www.mobileread.com/forums/sho...52#post2150952
PoP is offline   Reply With Quote
Old 07-15-2012, 10:16 AM   #4
geekmaster
Всё гениальное просто.
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: 5,066
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
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: 4,628
Karma: 4440239
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2
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
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
calibre isn't detecting new nook simple touch with glow light Tarry Devices 12 01-25-2014 12:44 PM
Free (Kindle) Reconstructing 3/11: Earthquake, Tsunami... [Japan Recent Events] ATDrake Deals, Freebies, and Resources (No Self-Promotion) 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 06:30 AM.


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