Quick hacked up app to create soft menu/back keys - SoftKeys v3.06

Search This thread

nemith

Senior Member
Jun 20, 2010
218
456
Thanks very much for this, sir.

About those images: what size do ya need? i can do them right now.

-K

Whatever would fix best at the bottom of the screen. I think 32x32 would probably be best or 48x48 with some white space around the outside.

If you can provide two images for each button. One standard one and one for when it's pressed.

-Brandon
 

nemith

Senior Member
Jun 20, 2010
218
456
I didn't want to start a new thread for this piece of information, so this looks like a good place to discuss it. My wife noticed that you can always access the back button by swiping from right to left across the notification toolbar. This worked on her non-root NC as well as my rooted one. Pretty cool!


That is cool. The problem is what to do when you are in full screen mode with no toolbar.
 

moovius

Senior Member
Sep 21, 2007
107
14
2010/12/04 - 1.03 - My fingers are too fat, I made everything in to image buttons and moved the launcher config to a prefs screen, if anyone has nicer icons let me know these are repurposed from generic android icons

Looks very nice, I like the larger buttons. I'm getting a Nook Color on Monday, so I'll be installing this for certain (as long as I don't screw up the root).
 

bpk

Member
Aug 17, 2009
36
75
Will this APK work on other tablets as well or is it nook specific?

As long as you are rooted and have su installed it should work fine.

One of my initial thoughts was the pandigital novel, I know they used the volume key remap for their work around. One other requirement though is they must have the "input" shell command, that is how this does the hardware key injection. It is part of stock aosp and most of the devices I've seen do have it so I would expect it to be there. If not, you could compile it separately and load it up, it just calls some public methods to inject keyevents in to the windowmanager. The only reason I can't do it from the SoftKey app is windowmanager will filter all keyevents that don't belong to either the foreground app, root, or a task that has the inject keys permission, which for whatever reason is refused if you try and use it.
 

cabbieBot

Senior Member
Apr 5, 2010
617
108
twitter.com
Great lil app. Ran into an issue.

I play WordFeud and after every turn you play, you are taken to a screen that has an ad. Most of the time there is a button that says 'Skip' but the developer made it to where sometimes you have to hit Menu to bring up an option to skip (on my phone of course). None of the SoftKey buttons work to bring up 'menu'. I then have to hit home, and use SystemPanel to kill the app in order to get back to the game. Am I doing it wrong?
 

nemith

Senior Member
Jun 20, 2010
218
456
Awesome progress so far!

I have updated my github repo adding back in the fancy dark gradient background. I think this makes it look a little better and more fitting.

Couple of ideas that I've had (that I haven't had that much luck finding the solution too)

1. If i click the 'n' button while SoftKeys is launched call finish() and exit. Alternatively you could launch the default launcher... Best yet. If you double table the 'n' button use the default launcher other wise use a second hit of the 'n' button to exit.

2. Remove the settings and replace it with a dialog to select the launcher. Long press the home button to select a new default

The idea being that visually you are presented with a real copy of what is found on other devices.

A better set of icons would be nice too if anyone is up to the task. I am thinking something like what is found on the face of the Nexus One.

pcAHn.jpg
 

Attachments

  • CAP201012042013.jpg
    CAP201012042013.jpg
    18 KB · Views: 425
Last edited:

jerrygon

Senior Member
Jun 23, 2007
460
10
Miramar, FL
Can you please post the one that has the fancy dark gradient background.

Thanks...



Awesome progress so far!

I have updated my github repo adding back in the fancy dark gradient background. I think this makes it look a little better and more fitting.

Couple of ideas that I've had (that I haven't had that much luck finding the solution too)

1. If i click the 'n' button while SoftKeys is launched call finish() and exit. Alternatively you could launch the default launcher... Best yet. If you double table the 'n' button use the default launcher other wise use a second hit of the 'n' button to exit.

2. Remove the settings and replace it with a dialog to select the launcher. Long press the home button to select a new default

The idea being that visually you are presented with a real copy of what is found on other devices.

A better set of icons would be nice too if anyone is up to the task. I am thinking something like what is found on the face of the Nexus One.

pcAHn.jpg
 

nemith

Senior Member
Jun 20, 2010
218
456
Can you please post the one that has the fancy dark gradient background.

Thanks...

Yes but I have made some other changes since then (you may or may not like)

I removed the Preferences/Settings and exit button.

If you haven't selected a default launcher yet and you hit the home button then you will be given a choice to select a home. There is a checkbox to check to make it the default for the 'home' softkey (not to be confused with the Android one, but very similar).

To use a different launcher than your default or to set a new default just long press on the home softkey. This will pop the dialog back up.

To exit the SoftKeys bar now you can tap anywhere off the bar (anywhere on the grayed out area above the bar).

Now I just need some fancy icons to finish it off (and some serious code cleanup)

Source code can be found here: https://github.com/bennetb01/SoftKeys
APK and screenshot is attached.
 

Attachments

  • SoftKeys-unofficial-nemith1.apk
    29.8 KB · Views: 104
  • CAP201012042311.jpg
    CAP201012042311.jpg
    13.7 KB · Views: 426
Last edited:

nemith

Senior Member
Jun 20, 2010
218
456
Another quick update with what I am doing

I fixed the launcher chooser dialog box, should look a little bit better.

Also I went ahead and created my own icons. It looks great!

Github has been updated and screenshot and apk are attached :)
 

Attachments

  • SoftKeys-unofficial-nemith2.apk
    22.9 KB · Views: 268
  • CAP201012050151.jpg
    CAP201012050151.jpg
    26.3 KB · Views: 959

darkrangr

Member
May 12, 2009
31
1
I couldn't it to work right either, I had to revert to the original source to get it going again.

Sent from my Nook using Tapatalk
 

Top Liked Posts

  • There are no posts matching your filters.
  • 60
    SoftKeys provides on screen keys for menu/home/back/search for devices that don't have those keys in hardware.

    SoftKeys is also available in the Android Market

    If you want to make themes for SoftKeys you will need the tools to build apks (eclipse/android sdk/etc) and the template from the git repository.

    http://git.hoopajoo.net

    Changelog:
    2011/01/11 - 3.06 - Fix notification keys, boot straight to launcher on system startup
    2011/01/11 - 3.05 - Fix notification softkeys <b>broken release</b>
    2011/01/10 - 3.04 - Adds dpad and up to 6 custom keys, ability to put device
    to sleep, improved performance for key injection, built in documentation, bugfixes
    2010/12/23 - 3.00 - Most of the layout code has been rewritten to allow for theming, couple of bug fixes, SoftKeys is now gpl3

    -----

    Old Changelog (I'm too lazy to reorder this newest to oldest):
    2010/12/04 - 1.01 - added launcher selector and remembers last launcher
    2010/12/04 - 1.02 - added themes layouts from nemith, looks more like his screenshots but the spinner text is still black so the launcher chooser is hard to read, hopefully I'll have some time to fiddle with that soon
    2010/12/04 - 1.03 - My fingers are too fat, I made everything in to image buttons and moved the launcher config to a prefs screen, if anyone has nicer icons let me know these are repurposed from generic android icons
    2010/12/05 - 1.04 - Added alternate long-press soft home key for secondary launcher like if you want to use the built-in nook home, added configurable options for what to do if you tap or double tap the nook button while in the softkeys screen, long press on menu/back sends an extra back to the app before sending the requested button for apps that bring up pause screens or something when you move them to the background (angry birds, etc)
    2010/12/05 - 1.05 - Integrated the dark theme from nemith, you can choose it in prefs now. Added options to disable the "exit" and "configure" buttons. If you disable "configure" you can still get to the preferences using the "menu" button in the notification bar (e.g. the normal menu button)
    2010/12/05 - 1.06 - fix broken key handling, menu and back didn't work, don't use 1.05
    2010/12/06 - 1.07 - add recent applications to top of the screen since we don't have a long-press-home recent apps dialog, looking in to re-ordering the buttons next
    2010/12/07 - 1.08 - This release adds options to re-order the softkeys, insert soft keys in to the notification area, disable the recent apps list, long press the background to configure if you lost the configure button, and some options for changing the background to dim/blurred/none (note: the notification soft keys show up in the notification area, not in the main status bar like the nook menu/back, I can't put things there as an application you would need to modify system jars to get this effect)
    2010/12/07 - v1.09 - Default to non-blurred background and added note about slowness, added option to return to softkeys after pressing back button
    2010/12/08 - v1.10 - Selecting "SoftKeys" for your single-press home action will make it so if you launch softkeys, it will go to the launcher unless you hit home again, e.g. single-press home to go to launcher anywhere, double-press home to go to softkeys

    2010/12/13 - v2.00 - This adds a new service overlay that is displayed above all apps allowing softkeys to be sent without having to mess with the home button. Default home key behavior has changed to be single click home from anywhere goes to your default launcher, double click home to get to the old softkeys interface. I'm still fiddling with service panel layouts and ideas so things will probably change, I just wanted to get some testing with something simple.
    2010/12/17 - v2.01 - The service panel can now be dragged around the screen, you can change it from horizontal to vertial by long pressing it, you can adjust the transparency of the panel and the icon size, and also control if it closes after sending key events. If you don't want the dialog background on the panel you can disable it to just have floating buttons. NOTE: the signing certificate has changed to a release cert, you will need to uninstall the old softkeys before installing this one
    2010/12/17 - v2.02 - Now you can move the button that brings up softkeys service, slightly better handling for switching horizontal/vertical layout by long press
    3
    Thanks! I agree with you - I didn't want to permanently re-assign the volume buttons, as I use them in some apps.

    One request, if possible ) - Is there any way to make it go to launcher pro (or whatever you want as default) when pressing "Home" in the app? Right now, it asks me to "Pick Home" every time.

    I never personally use the "home" button, I use the quick drawer thing in the notification bar, so I don't really use a launcher. I could probably quickly add a button just for an alternate home or use last home I guess/choose new home I guess. I'll see what I can do. I've also though about adding arrow soft keys, for using in like connectbot, is there any interest in that?

    There are also other minor irritating things, like apps that exit when they are not in focus will not work with this hack. For example, monkey kick (a game my son loves to play) will exit if it's not in focus so it never receives the soft keys. I suppose it doesn't matter though since it doesn't use the screen completely anyway, so he just gets to play on my old g1 :p
    3
    For anyone interested in making themes I have added theme support to softkeys 3, you can now change just about anything. It works very similar to the way ADW launcher does themes, at a basic level you can just drop in new icons and stuff. If you want to get more advanced you can also replace some of the layout parts using xml which was kind of a bear to get working correctly.

    I had all this ready yesterday but when I was getting ready for final testing I got hit with that annoying 1.01 update from bn and had to reroot. On the positive side I found that the autonooter is a pretty sweet script, I was way to lazy to set up market access and stuff before. Plus it came with softkeys, sweet :p

    Thanks for the support and I do plan on putting softkeys in the market but as a free download, I just feel that the market for this kind of application is so small that it doesn't make any sense to fragment it with different versions of similar apps. I mean it's basically only people who don't have official android devices, because a real android device would have all the hardware buttons needed. And even of that group it's only people who are modding their device for more functionality. It seems to me that for such a small group it would make more sense to work together because the developer pool is going to be so small.
    2
    I put the source up at

    http: // git.hoopajoo.net

    (take out the spaces I can't post links apparently)

    That page has a list of my public git urls available, the last one is SoftKeys

    if anyone wants to check it out, I'm currently looking at remembering the last launcher picked and defaulting to that for people that use launchers.

    -- the rest of this is just for people looking in to the source, to provide some background to why I did it this way and alternate ideas I had --

    If any devs look at it I thought I'd post some of my reasons for doing it this way:

    1) I looked at creating a custom init service bound to a keycode at first, this would have made it so you didn't need superuser but would have required modifying your ramdisk. Even just making a daemon and communicating through some kind of pipe would require modifying the ramdisk to get it in init. In the end I abandoned the idea because it seemed easier for most normal people to just install an apk.

    2) I looked at binding this to the camera button and remapping it in the keylayout, that would preserve the default home screen selections, but would require modifying a file in your /system/ so people would need to adb their stuff. Again I thought an apk would be easier and adding in shell commands would just complicate things for people and I'm not very good at support :p

    3) I spent a LOT of time looking through git repos from aosp to find out if there was some way to bind to the long-press home and take over the recent apps list, since it doesn't even work. This would preserve your home settings and not even remove an existing function. After several hours grepping through the core.git stuff I decided this was just easier to do. If figured good enough is usually good enough. Though if someone can figure this out it would be sweet.

    4) I really was hoping that we could just pull whatever archos is doing since that seems ideal, completely soft buttons. However after downloading the aos firmware I found it was encrypted and apparently currently can only be decrypted by the devices using the public key stored on them somewhere and I'm not aware of anyone having dumped their system images yet.

    Also I've been looking through the superuser source to see how they handle the popups, they do a good job of not killing the running app and being all around unobtrusive, doing it their way for the popup buttons would be really sweet since it never seems to break the currently running app.
    2
    I do like those buttons, I'm not much for making things look nice, typically I just do back end stuff. If you want to rebase against head and post your git repo I'll merge those changes in to main.

    I started using launcher pro and realized it does suck way too much to have to select your launcher every time. It's just 1 button press but I'm too lazy.

    And for people re-installing, from adb you have to do:

    adb install -r <APK>

    Also to remove packages I use appremover, or you can use astro file manager with the package manager under the menu.