View Single Post
Old 07-29-2010, 07:40 PM   #1
isotherm
Connoisseur
isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.isotherm can program the VCR without an owner's manual.
 
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.
Attached Files
File Type: zip hotkeys.zip (5.1 KB, 452 views)

Last edited by isotherm; 07-29-2010 at 08:40 PM.
isotherm is offline   Reply With Quote