[N2E] Nook Touch - App Support for Hardware Buttons

463 posts
Thanks Meter: 24
By pcm2a, Senior Member on 16th June 2011, 04:19 PM
Post Reply Email Thread
I don't know about everyone else but I would love to see apps that support our Nook's hardware buttons for scrolling and turning pages. I created an small app just to find out exactly what these buttons were. I have attached the test apk and the source for it.

The buttons generate a KeyEvent that can be captured in the normal manner for handling key presses.
Left top button - 92
Left bottom button - 93
Right top button - 94
Right bottom button - 95

All the developer has to do is test for those in addition to whatever they are already monitoring for. I am going to begin emailing developers with this information and see if I get any "takers". I have emailed the following and will post a status here if I hear back:

Kindle - 5/16: Received an email saying the suggestion would be forwarded on to the appropriate development group
NewsRob (via google group) - 5/16: The developer is going to add page up/down and article up/down support!
FeedR - 5/16: Email sent
Aldiko - 5/16: Email sent
FBReader - 5/16: Email sent

In addition I am going to add hardware button support to some open source apps. I have located a number of open source RSS apps:

As an example of what we can do I have attached an updated FeedGoal where I have added support for the hardware buttons to scroll up and down on a feed article.

Update 5/17/2011:
I have modified the Browser from the stock Eclair to support page buttons and compiled it. When I try to start it on the Nook it comes up and then shuts down. One of the times I saw a "signing in" box. My thoughts is that it is trying to do something that requires gapps on the phone? If anyone has any ideas I'd be glad to try them.
Attached Files
File Type: apk FeedGoal.apk - [Click for QR Code] (408.1 KB, 100 views)
File Type: txt TouchTest.txt - [Click for QR Code] (893 Bytes, 179 views)
File Type: apk TouchTest.apk - [Click for QR Code] (13.7 KB, 133 views)
The Following 5 Users Say Thank You to pcm2a For This Useful Post: [ View ] Gift pcm2a Ad-Free
16th June 2011, 04:20 PM |#2  
OP Senior Member
Thanks Meter: 24
* Reserved
16th June 2011, 10:01 PM |#3  
xboxexpert's Avatar
Senior Member
Thanks Meter: 1,186
Donate to Me
Keys are actually

The Following User Says Thank You to xboxexpert For This Useful Post: [ View ] Gift xboxexpert Ad-Free
17th June 2011, 12:02 AM |#4  
OP Senior Member
Thanks Meter: 24
Originally Posted by xboxexpert

Keys are actually


Those numbers are the scancodes from the keymap file TWL4030_Keypad.kl. If you are wanting to watch for key inputs in an Android application you override the "onKeyDown(int keyCode, KeyEvent event)" method and the "int keycode" that get's printed out is 92-95.

The format of the keymap file (TWL4030_Keypad.kl) is "key SCANCODE KEYCODE [FLAGS...]". In your example 407 is the SCANCODE and "RIGHT_NEXTPAGE" is the KEYCODE. The numerical value of "RIGHT_NEXTPAGE" is either 94 or 95 depending on how you set your Nook up.

If someone wants give the two attached apk's and test and verify (I've already ran them myself) that they do work as intended that would be great.
- The TouchTest should print out 92-95 (keycode) on the screen when you press them.
- The FeedGoal should page up and down when you press the right or left side keys. I may go back and change the left side to be page up/down and the right side to be article back/forward.
23rd June 2011, 02:10 PM |#5  
rev0l's Avatar
Thanks Meter: 33
Post ReadItLater
I add a ticket to ReaditLater Support Forum.

i contact the dev of electrodroid, too

are there new answers from the devs?
24th June 2011, 01:01 AM |#6  
Thanks Meter: 28
If you remaps two keys to VOLUME_UP and VOLUME_DOWN, almost all reading-centric programs work will hardware buttons. I have tested:

Read It Later
BuzzBox RSS reader

They all works with remapped buttons.
The Following 2 Users Say Thank You to aruangra For This Useful Post: [ View ] Gift aruangra Ad-Free
24th June 2011, 03:25 AM |#7  
rev0l's Avatar
Thanks Meter: 33
Originally Posted by aruangra

If you remaps two keys to VOLUME_UP and VOLUME_DOWN, almost all reading-centric programs work will hardware buttons.

yes, of course.
but this is just a workaround and i already recognized that there are situations where i have to take the nook in the other hand to turn a page...
for example: i use the left keys remapped to volume for readitlater, so i can only use the right keys on the default reader app (which i prefer).

i think for some apps you will always have to do this remapping, especially for the kindle app in my thougts.
and it seems to me that the devs will easily can integrate this buttons in their apps.

a lot of other apps are already working with the default mapping:
titanium backup
root explorer
17th July 2011, 03:33 AM |#8  
Senior Member
Flag Sao Paulo
Thanks Meter: 31
Is there no way to remap the hardware buttons using like a driver software (sorry, completely noob regarding android software). Remapped buttons would help on repligo and ezpdf, my preferred readers.
17th July 2011, 04:29 PM |#9  
Junior Member
Thanks Meter: 10
I liked seeing the NewsRob support in the change log. But it only scrolls half a page down so you have to hit it twice.

I found that my old technique of remapping the key to SPACE worked better; SPACE is a page-down shortcut for most WebView apps. Unfortunately my SHIFT SPACE mapping in the layout file seemed to ignore the shift part. :(

Android 3.0 adds real page up/down keys finally, so more apps should support the keycodes then. This isn't just a Nook issue; I've been trying to fix this on my Galaxy Tab too.

I blame Apple for not including a page down function because it's so "cool" to flick the screen around. Hope you have good timing.
25th July 2011, 08:32 AM |#10  
Junior Member
Thanks Meter: 5
Good news, everyone!

This weekend I received reply from FBReader authors. Here is the translation:

Since version 1.1.3 FBReader is able to read external file with actions mapped to keys. One can put keymap.xml file into main directory, which is /sdcard/Books by default.
File format can be seen in example:
<?xml version="1.0" encoding="UTF-8"?>
	<binding key="4" action="cancelMenu"/>
	<binding key="23" action="processHyperlink"/>
	<binding key="24" action="volumeKeyScrollBackward"/>
	<binding key="25" action="volumeKeyScrollForward"/>
	<binding key="66" action="processHyperlink"/>
All possible actions are here:
	String SHOW_LIBRARY = "library";
	String SHOW_PREFERENCES = "preferences";
	String SHOW_BOOK_INFO = "bookInfo";
	String SHOW_TOC = "toc";
	String SHOW_BOOKMARKS = "bookmarks";
	String SHOW_NETWORK_LIBRARY = "networkLibrary";

	String SWITCH_TO_NIGHT_PROFILE = "night";
	String SWITCH_TO_DAY_PROFILE = "day";

	String SEARCH = "search";
	String FIND_PREVIOUS = "findPrevious";
	String FIND_NEXT = "findNext";
	String CLEAR_FIND_RESULTS = "clearFindResults";

	String SET_TEXT_VIEW_MODE_VISIT_HYPERLINKS = "hyperlinksOnlyMode";
	String SET_TEXT_VIEW_MODE_VISIT_ALL_WORDS = "dictionaryMode";

	String TURN_PAGE_BACK = "previousPage";
	String TURN_PAGE_FORWARD = "nextPage";

	String VOLUME_KEY_SCROLL_FORWARD = "volumeKeyScrollForward";
	String VOLUME_KEY_SCROLL_BACK = "volumeKeyScrollBackward";
	String SHOW_MENU = "menu";
	String SHOW_NAVIGATION = "navigate";

	String GO_BACK = "goBack";
	String EXIT = "exit";
	String SHOW_CANCEL_MENU = "cancelMenu";

	String ROTATE = "rotate";
	String INCREASE_FONT = "increaseFont";
	String DECREASE_FONT = "decreaseFont";

	String PROCESS_HYPERLINK = "processHyperlink";

	String SELECTION_SHOW_PANEL = "selectionShowPanel";
	String SELECTION_HIDE_PANEL = "selectionHidePanel";
	String SELECTION_CLEAR = "selectionClear";
	String SELECTION_COPY_TO_CLIPBOARD = "selectionCopyToClipboard";
	String SELECTION_SHARE = "selectionShare";
	String SELECTION_TRANSLATE = "selectionTranslate";
	String SELECTION_BOOKMARK = "selectionBookmark";
Program must be restarted in order to pick up changes in config file.

Can anyone test if this really works? I can't test it right now.

And, I suggest to make a donation to this wonderful program authors.

The Following User Says Thank You to DenisTheMenace For This Useful Post: [ View ] Gift DenisTheMenace Ad-Free
25th July 2011, 04:53 PM |#11  
Senior Member
Flag Sao Paulo
Thanks Meter: 31
Great news!
If other developers would do the same, we'd be in heaven.
I'll only be able to try it tomorrow, but I'll inform as soon as I do it.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes