07-29-2010, 07:40 PM | #1 |
Connoisseur
Posts: 79
Karma: 187319
Join Date: Jul 2010
Device: Kindle 2
|
Hotkeys for Kindle 2
I've developed this script to add customized hotkey support to the Kindle 2. It doesn't modify any files, so it should be able to peacefully coexist with official updates. For now I included sample shortcuts which add SHIFT-1 for exclamation point, etc. But the sky is the limit; anything you can think of to do in a shell script can be the action of a hotkey. I have a script developed for GPS coordinates that I hope to post in the other thread soon.
Below I've reproduced the README included in the zip file. Before I do the work of making this into a package, I would appreciate feedback from anyone who can load this onto their Kindle via telnet/ssh access. Once loaded, you can customize your shortcuts via mass storage. Please let me know if you find this useful! Code:
NOTE: This has been designed and tested on a Kindle 2. It may or may not work on other devices. At this time, you must understand how to access the root filesystem of your Kindle. Hopefully an update package will be developed soon. INSTRUCTIONS 1. Plug your Kindle into your computer as a mass storage device. 2. Create a folder called: hotkeys 3. Copy the contents of this ZIP file into the newly created folder. 4. Log in to your Kindle via telnet, ssh, or serial console. 5. Set the filesystem writable by executing: mntroot rw 6. Install the script: mv /mnt/us/hotkeys/hotkeys /etc/init.d 7. Enable the script to be started automatically: ln -s /etc/init.d/hotkeys /etc/rcS.d/S75hotkeys 8. Reset the filesystem as read-only: mntroot ro 9. To begin using the script without rebooting: /etc/init.d/hotkeys start Custom hotkeys are now available for your use, and you may now switch back to USB storage device mode. Load scripts for any desired hotkeys into the folder you created for them. When keys are pressed, the "hotkeys" folder is checked for both one and two key scripts, e.g. if the user has pressed SYM, 1: \hotkeys\SYM-1.sh -- then -- \hotkeys\SYM.sh The names of the keys are as shown on the Kindle's keyboard, except these: NEXTL, NEXTR, ENTER, SHIFT, AA, UP, DOWN, LEFT, RIGHT, SELECT The send_keys and send_string functions are available for your use inside of hotkey scripts. Their format is: send_keys key1 [key2 [key...]] send_string 'string' ['keys-before' ['keys-after']] The send_string function will type out whatever 'string' you specify, using SYM as necessary for symbols. Before typing, it will simulate pressing any keys listed in 'keys-before', and after typing it will press the keys listed in 'keys-after', if any. Here are examples of their usage (each has the same ultimate effect): send_keys DEL DEL SHIFT H E L L O SPACE W O R L D SYM RIGHT SELECT ENTER send_string 'Hello world!' 'DEL DEL' 'ENTER' LICENSE AND DISCLAIMER You may freely use and share unmodified versions of this software so long as you do not charge a fee for redistribution. This software may not be bundled, preloaded on devices, included in collections, or otherwise aggregated without prior written consent of the copyright holder. All other rights reserved to the maximum extent permitted by applicable law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Last edited by isotherm; 07-29-2010 at 08:40 PM. |
07-29-2010, 08:00 PM | #2 |
BLAM!
Posts: 13,477
Karma: 26012464
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
That's pretty neat! Great work, thanks!
On a sidenote, you just broke my brain with those awk scripts . For the life of me, I can't stomach the awk syntax, and never had the courage to delve into it ^^. |
Advert | |
|
07-30-2010, 03:19 PM | #3 |
Connoisseur
Posts: 79
Karma: 187319
Join Date: Jul 2010
Device: Kindle 2
|
Any comments after use? Should I make an update package?
I (ab)used awk so that I could use only built-in commands. I have scratchbox set up as well as an Ubuntu ARM chroot, so it might be better to compile a C program for the purpose... |
07-30-2010, 09:12 PM | #4 |
Connoisseur
Posts: 79
Karma: 187319
Join Date: Jul 2010
Device: Kindle 2
|
If you don't like starting the device automatically in USB networking mode, here is a nice hotkey script. Place as \hotkeys\ALT-U.sh:
Code:
send_string ';debugOn' 'DEL WAIT' 'ENTER WAIT WAIT WAIT WAIT' send_string '`usbNetwork' 'DEL WAIT' 'ENTER' |
07-31-2010, 07:57 AM | #5 |
Member
Posts: 12
Karma: 152738
Join Date: Jul 2010
Device: Kindle DXG
|
Whoo hooo! Thank you so much for this! I tested it on my new DX Graphite and it works perfectly. Sure, a package would also be nice to have :-). Keep up the good work!
|
Advert | |
|
07-31-2010, 03:51 PM | #6 |
Connoisseur
Posts: 79
Karma: 187319
Join Date: Jul 2010
Device: Kindle 2
|
Glad to hear it also works on the DX... Although I guess SHIFT+1 etc. aren't very useful for it! A lot of these hotkey scripts rely on the layout of the SYM box or other menus, so hopefully they all work on the DX as well.
Here is a script to start the web browser from virtually anywhere you are in the Kindle. Place as \hotkeys\ALT-W.sh: Code:
send_keys HOME MENU WAIT DOWN DOWN DOWN DOWN DOWN DOWN SELECT WAIT SELECT |
08-01-2010, 11:26 AM | #7 |
Polymath in training
Posts: 32
Karma: 10
Join Date: Jul 2010
Location: Los Angeles
Device: Kindle2 (Global)
|
Very cool stuff.
For one thing we certainly need access to more characters. I can't even type my street name (Cañada) properly! Will this let us do that sort of thing? hhp |
08-01-2010, 03:43 PM | #8 |
Connoisseur
Posts: 79
Karma: 187319
Join Date: Jul 2010
Device: Kindle 2
|
Can you enter that key normally (even if it takes a lot of keystrokes)? For now, this is basically like macro functionality. I haven't figured out how to inject arbitrary keys into the framework yet.
|
08-01-2010, 05:22 PM | #9 |
Polymath in training
Posts: 32
Karma: 10
Join Date: Jul 2010
Location: Los Angeles
Device: Kindle2 (Global)
|
I don't get it - you mean to get a "ñ"? I see no way of entering it (except maybe copy-pasting from a document).
hhp Last edited by Hrant; 08-01-2010 at 05:25 PM. Reason: Clarification |
08-03-2010, 03:29 PM | #10 |
Groupie
Posts: 159
Karma: 1005378
Join Date: May 2008
Location: Cambria, California
Device: Kindle 2
|
Can I set up a hotkey to take the place of pressing the 5-way controller on my Kindle 2? It cracked recently, and is neither consistent nor responsive any longer. I'd love to be able to use hotkeys for this. Ideally, I would want Enter to function in this capacity.
|
08-03-2010, 03:40 PM | #11 |
Connoisseur
Posts: 79
Karma: 187319
Join Date: Jul 2010
Device: Kindle 2
|
Yes, you could! Place as \hotkeys\ENTER.sh:
Code:
send_keys SELECT |
08-06-2010, 10:46 AM | #12 |
Groupie
Posts: 159
Karma: 1005378
Join Date: May 2008
Location: Cambria, California
Device: Kindle 2
|
That's great! This will save me a lot of frustration. Thanks so much.
EDIT: Woah - I think I spoke too soon. That looks a bit more complicated than I can handle. I'll have to wait for a version for Dummies (or at least for "less smarties") Last edited by jupstin; 08-06-2010 at 10:57 AM. |
08-14-2010, 07:34 PM | #13 |
Connoisseur
Posts: 61
Karma: 3308
Join Date: Aug 2010
Location: France
Device: Kindle 4 (non-touch), Kindle DX Graphite, Asus Transformer
|
Hello.
Would it be possible, with this hack, to force the Kindle to refresh a second time when pressing the NEXT or PREVIOUS buttons? |
08-14-2010, 07:41 PM | #14 |
Polymath in training
Posts: 32
Karma: 10
Join Date: Jul 2010
Location: Los Angeles
Device: Kindle2 (Global)
|
Good idea - to get rid of the ghosting, right?
This would also be useful when viewing PDFs. What I'm having to do sometimes is turn the Menu on-off to get rid of ghosting. hhp |
08-14-2010, 07:59 PM | #15 |
Connoisseur
Posts: 61
Karma: 3308
Join Date: Aug 2010
Location: France
Device: Kindle 4 (non-touch), Kindle DX Graphite, Asus Transformer
|
I'm particularly annoyed by the ghosting when looking at a series of pictures.
I don't think it's too noticeable when reading books but you can clearly see it when using the picture viewer. So yeah, I'm thinking that a double refresh would solve that problem (althought using a little more battery). |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
The Frugal Kindle ~ Frugal Finds Under $9 for the Kindle (Kindle eBook Resource) | eTrubrown | Self-Promotions by Authors and Publishers | 3 | 10-10-2010 06:12 PM |
Transfer Kindle books from Kindle PC to Kindle 3 | ppearce | Amazon Kindle | 15 | 09-16-2010 05:11 PM |
Font hacks for the Kindle 2, Kindle International and Kindle DX | edge777 | Kindle Developer's Corner | 17 | 04-30-2010 04:11 PM |
$0.01 in Kindle Store: Interactive Sudoku for Kindle 2 and Kindle DX - Volume 1 | Xia | Deals and Resources (No Self-Promotion or Affiliate Links) | 2 | 11-07-2009 10:06 AM |