Buttonmap: Use the Left / Right keys in all reader apps
Various reader apps recognize different buttons for turning to the next or previous page. The wiki offers various static button mappings for the Left / Right keys
, but none of the static mappings is sufficient for all reader apps.
Inspired by this hack on the XDA forum
, I've modified the pgdn program provided there to work for the PRS-T1. With this hack, it's possible to remap the Left / Right keys dynamically, depending on which app is currently running, to Dpad Left/Right, Volume Up/Down, nothing (needed for Sony's built-in reader app), or whichever other key is needed.
The Buttonmap app wraps the pgdn daemon and the default configuration file into an easily installable package.
The default configuration file allows using the Left / Right keys for the following apps (tested): Reader (built-in), Browser (built-in), Aldiko Reader, Amazon Kindle for Android, FBReader, InstaFetch Pro, Google Reader, Google Books (old 1.x versions), CoolReader.
- Download the Buttonmap.apk file and install it on the Reader.
- Reboot. If your “su” uses the Superuser app, grant Buttonmap permanent root privileges when the superuser request pops up. This occurs shortly after reboot; don’t let the request time out, or you will have to reboot again.
The pgdn configuration file is /sdcard/.pgdn. Buttonmap creates an example configuration file as /sdcard/.pgdn.dist. It also creates a new /sdcard/.pgdn file if it does not yet exist, but it does not overwrite an existing one. When you upgrade, you can copy the contents of .pgdn.dist to .pgdn or simply delete your the old .pgdn.
When you change the .pgdn config file, you need to restart the pgdn daemon as root (“killall pgdn && /data/data/com.github.altruizine.Buttonmap/files/pgdn”), or just reboot the system.
Please find the source code of this program at https://github.com/altruizine/pgdn
. Bug reports / enhancements welcome!
Edits (in reverse order):
- 2012-09-03: Updated configuration file with user-contributed settings
- 2012-08-23: Released wrapper app Buttonmap.apk.
- 2012-08-20: Updated zip file: Added exception for CoolReader, which has native support for the PRS-T1; added a configuration for the Terminal Emulator. Added mention of the Autostart app.
- 2012-08-06: Updated zip file: Added exception for built-in browser, which can interpret the Left/Right keys without a keyboard mapping.
Archived: Installation notes for pgdn daemon without Buttonmap app:
- Make sure you're rooted and have root adb access.
- Copy the provided pgdn binary to /data/local/bin/pgdn and make sure it's executable.
adb push pgdn /data/local/bin/pgdn
adb shell chmod 755 /data/local/bin/pgdn
- Copy the attached dot.pgdn config file to /sdcard/.pgdn (mind the dot). Customize this file to add keyboard mappings for other reader apps.
adb push dot.pgdn /sdcard/.pgdn
- Make sure pgdn is run as root at boot. I'm using the SManager app to do this. Reportedly, the Autostart app works as well (see comments below).