FORUMS

[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
25th July 2011, 04:53 PM |#11  
Senior Member
Flag Sao Paulo
Thanks Meter: 31
 
More
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.
25th July 2011, 08:48 PM |#12  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by DenisTheMenace

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.
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.

Thanks! It works very nicely with FBReader. My keymap.xml file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
	<binding key="92" action="nextPage"/>
	<binding key="93" action="previousPage"/>
	<binding key="94" action="nextPage"/>
	<binding key="95" action="previousPage"/>
</keymap>
Does anyone know the key number of the Nook button? It's quite useless for FBReader and it would be nice to remap it to some other function. Thanks!
26th July 2011, 10:30 PM |#13  
Senior Member
Flag California
Thanks Meter: 517
 
More
Anyone thought of trying to create a service that'd catch the button presses outside of the stock apps that'd then send the right command for whatever. For example if you press the page forward button or page backward button in stock apps it'd function as designed. If you push it somewhere else like within your custom launcher or another app it'd perform as menu/home/back whatever
30th July 2011, 09:21 AM |#14  
Junior Member
Thanks Meter: 5
 
More
Quote:
Originally Posted by GabrialDestruir

Anyone thought of trying to create a service that'd catch the button presses outside of the stock apps that'd then send the right command for whatever. For example if you press the page forward button or page backward button in stock apps it'd function as designed. If you push it somewhere else like within your custom launcher or another app it'd perform as menu/home/back whatever

Yes for remapping the n-button. See this post. But still haven't had the time to do it. Too busy with work.
1st August 2011, 04:52 AM |#15  
Junior Member
Flag Edmond, OK
Thanks Meter: 4
 
More
Quote:
Originally Posted by GabrialDestruir

Anyone thought of trying to create a service that'd catch the button presses outside of the stock apps that'd then send the right command for whatever. For example if you press the page forward button or page backward button in stock apps it'd function as designed. If you push it somewhere else like within your custom launcher or another app it'd perform as menu/home/back whatever

I've started working on exactly this during this weekend. I have so far succeeded in creating service that runs in the background and makes the upper left button a "HOME" button - meaning it shows the home activity of your choice rather than the built in menu like the n button. I'll be glad to give more technical details on what I have learned so far (when I have time, probably next weekend).

In the mean time, I would like input from other users as to some specifics on how it should work.

Here is my current vision:
- Have option to start the service manually or automatically start at boot (currently hard coded to start a boot)
- The keylayout files can remain untouched so that they still work properly for the stock applications
- the service will be aware of what Activity is in the foreground and remap purpose the buttons accordingly.
- there will be a settings Activity that lets you choose the functionality of each button on a per application basis
- the choices will to be to broadcast an Intent or to create a virtual key press (for example, my "HOME" button does not actually cause a HOME key press, but broadcasts a act...MAIN cat...HOME intent, my next experiment will be to send Vol Up/Down keys when Kindle app is running)

And this is slightly off topic, but I would like put this on sourceforge or google so that others can contribute and have easy access to it. I've never done that before, so advice on this would be appreciated.
The Following 3 Users Say Thank You to mycr0ft For This Useful Post: [ View ] Gift mycr0ft Ad-Free
1st August 2011, 09:03 AM |#16  
Junior Member
Thanks Meter: 5
 
More
Quote:
Originally Posted by mycr0ft

but I would like put this on sourceforge or google so that others can contribute and have easy access to it. I've never done that before, so advice on this would be appreciated.

May I suggest github? git is much more sophisticated than CVS/SVN and their clones.

I basically agree with the app functionality. May be I will take part in implementation (I wish there will be ~36-48 hours in a day )
The Following User Says Thank You to DenisTheMenace For This Useful Post: [ View ] Gift DenisTheMenace Ad-Free
8th August 2011, 04:57 AM |#17  
Junior Member
Flag Edmond, OK
Thanks Meter: 4
 
More
Thanks for the advice. github looks promising.

Anyone interested can have a look:
Code:
https://github.com/mycr0ft/nook-touch-button-service
I've run into a bit of a problem with simulating a key press. The android developers have not made it easy (which is good for device security).
- I have tried Instrumentation.sendKey..., but that only works withing the same application. Even with the INJECT_EVENT permission, you cannot inject events into other applications (unless they are signed by the same packager). Repackaging every single app that you load does not sound like a good option.
- I have tried using the 'sendevent' shell command. This appears to be limited to only duplicating scan codes keys that actually exist.
- I am currently trying to compile uinput driver (available in the source code download from bn) and load it using insmod. I am stuck here for the time being because I can't figure out how to get it to compile to the right kernel version (version magic mismatch in dmesg)
8th August 2011, 05:35 PM |#18  
Member
Flag Paris
Thanks Meter: 29
 
More
I think you will need root to inject a key event in an other app

You can look at the SoftKeys source code (here), it may help you.
In the past, SoftKeys used a script called "input" to inject events (according to http://forum.xda-developers.com/show...&postcount=309) but now it seems that it uses something else ...
The Following User Says Thank You to mdall For This Useful Post: [ View ] Gift mdall Ad-Free
9th August 2011, 04:54 AM |#19  
Junior Member
Flag Edmond, OK
Thanks Meter: 4
 
More
mdall, thanks very much. this is very useful information.
18th August 2011, 12:28 PM |#20  
Junior Member
Flag Latina
Thanks Meter: 0
 
More
Thumbs up Droid Comic Viewer
I think also Droid Comic Viewer would benefit from hardware buttons support.

It's a nice little comic reader app supporting all relevant formats (CBR, CBZ, ACV & image formats). Animations can be disabled and there's no dependency with touchscreen interface (it can be entirely operated with button actions). This would make it perfect for an e-ink screen.

I sent an email to the devs today, let's hope they get back to us!
19th August 2011, 02:20 AM |#21  
Senior Member
Flag Sao Paulo
Thanks Meter: 31
 
More
Question
Droid comic viewer is quite good, and allows using volume buttons for going to next / previous page.
But what I don't get is how can I convert volume buttons into nook's physical buttons? Do I have to change a file for that (keybinding)? What am I supposed to do? Can anyone show me what to do?

As for Droid Comic Viewer, you can map the volume_up and volume_down buttons for changing pages, and I use an inverted volume (down for next page and up for previous page) without "changing" my original setup - upper buttons for volume up and lower buttons for volume down.
Post Reply Subscribe to Thread

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

Advanced Search
Display Modes