![]() |
#1 |
Junior Member
![]() Posts: 8
Karma: 12
Join Date: Jul 2012
Device: kindle touch
|
Simulating Button Presses Externally
I have a kindle touch and I was wondering what would be required to send button press events externally with a cable. Ideally I would want to be able to send these through a microcontroller.
Not sure how it works but it would be awesome if it was just a serial connection. Any input or ideas would be helpful, thanks. |
![]() |
![]() |
![]() |
#2 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
It would be much easier to talk to your kindle through USB or wifi. There is now a free USB Host stack in software for microprocessors so it could talk to the kindle. Or use the kindle OTG as a USB host so the microprocessor can use smaller simpler USB device mode. Once you have that all figured out, you still need to know how to feed keypresses to the K5. This procedure is documented for a DX and K3, but I have not seen how to do it on a K5 yet. If somebody knows how to force (native mode) keypresses on a K5, please post that info (or a link to it) here. Thanks. Last edited by geekmaster; 07-15-2012 at 01:00 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Junior Member
![]() Posts: 8
Karma: 12
Join Date: Jul 2012
Device: kindle touch
|
Quote:
|
|
![]() |
![]() |
![]() |
#4 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
It can be done, but at this time you would have to do the basic research yourself (or wait for somebody else to do it). |
|
![]() |
![]() |
![]() |
#5 | |
Junior Member
![]() Posts: 8
Karma: 12
Join Date: Jul 2012
Device: kindle touch
|
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
If you really feel up to opening the kindle and soldering wires to it (or to the special micro plug it needs to use its serial connector), then you can do 1.8v TTL serial I/O if you really want to. But that port is also used to show syslog events, so your microprocessor would have to deal with all that extra output (or could just ignore it). Stuff sent to that port would also be sent to the serial "console", so you would need to reconfigure that serial port com device to use it for a dedicated application. Last edited by geekmaster; 07-15-2012 at 12:59 AM. |
|
![]() |
![]() |
![]() |
#7 |
Junior Member
![]() Posts: 8
Karma: 12
Join Date: Jul 2012
Device: kindle touch
|
Okay final question. If I were to do this through a linux computer (or mcu) is there a command reference for different events (swipe left, swipe right, etc)
|
![]() |
![]() |
![]() |
#8 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
https://www.mobileread.com/forums/sho....php?p=1932094 Also, you can read the touchscreen linux event device and process its raw binary data directly. There is an example of that in the "geekmaster signature capture script" here: https://www.mobileread.com/forums/sho...d.php?t=178356 Of course, the GPL source code for the K5 is the best source of information. You can download that for free from the links in the "source code" sticky thread. That is about all the relevant information that I am aware of at this time... Last edited by geekmaster; 07-15-2012 at 01:18 AM. |
|
![]() |
![]() |
![]() |
#9 | |
Junior Member
![]() Posts: 8
Karma: 12
Join Date: Jul 2012
Device: kindle touch
|
Quote:
Awesome, you have been a gigantic help! I am really going to try to document any progress I make on this front so I can give back to this awesome community. |
|
![]() |
![]() |
![]() |
#10 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Beware that when disabling Xorg (as many native mode apps do, especially when using the touchscreen), then the Xorg log file will not get new gesture events. You would need to deal with that somehow. Or do your own gesture recognition from raw touchscreen data. Or discover the "right" way. Good luck.
|
![]() |
![]() |
![]() |
#11 | |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,016
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
headphone jack
Quote:
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]# |
|
![]() |
![]() |
![]() |
#12 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
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. Last edited by geekmaster; 07-15-2012 at 10:13 AM. |
|
![]() |
![]() |
![]() |
#13 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Hmm... It seems that waiforkey no longer returns a keycode for headphone events (on my K3 or my K5). I am certain that it did in the past. Why would amazon change that?
K5 waitforkey returns headphone and rotation events while booted from diags, but not from main. Last edited by geekmaster; 07-15-2012 at 10:24 AM. |
![]() |
![]() |
![]() |
#14 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
lsmod in both environments, see if maybe "main" is not loading a module for it. |
|
![]() |
![]() |
![]() |
#15 |
Junior Member
![]() Posts: 8
Karma: 12
Join Date: Jul 2012
Device: kindle touch
|
What about detecting the usb being powered?
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[KT]Turn store button on search bar to browser button | aditya3098 | Kindle Developer's Corner | 74 | 05-19-2017 08:33 PM |
DIY Kindle voice control (simulating key presses) | Acorn | Kindle Developer's Corner | 35 | 10-07-2012 01:36 PM |
Filling a memory card externally to the reader | lininjim | Sony Reader | 4 | 10-27-2011 08:21 PM |
DR800 updating metadata externally | Mr. X | iRex | 7 | 04-10-2010 12:14 PM |
The Clerkenwell Presses | ShortNCuddlyAm | Writers' Corner | 16 | 01-30-2010 06:21 PM |