Re-mapping keys / Creating or re-assigning keyevent
OK, I've looked around but can't find an answer. Or at least an answer that I can understand. Basically what I'm trying to do is add the ability to quit/exit an app. I've read all about the differing opinions on quitting an app versus pressing back. However, just for my own self-teaching purposes, I want to learn how to do this. I'd like to be able to long-press or double tap a key to either immediately exit an app, or bring up an alternate pop-up menu that allows you to choose an action.
I am thinking specifically in relation to the Browser. The quit option was more necessary pre-CM6 because often times, it would take forever to load the home screen after pressing "home" in order to stop using the browser. A simple exit/quit option that some apps have, usually acts much quicker. Everyone knows that if you've been browsing through a bunch of webpages, hitting the back button repeatedly is a pain in the ass. The other option is to hit menu-->windows-->then close all the open windows-->then hitting the back button once the new window pops up because browser automatically opens a new page once all open windows have been closed.
Another annoyance is not being able to quickly get to your home page. Is there a way to remap/reassign/whatever, keys so that on long-press or double-tap of say, menu, or trackball, a menu pops up which has a "exit/quit" option and a "home page" option?
Another option is to add to the menu (when you hit menu), a "quit/exit" or "homepage" option.
Any help would be appreciated.