[Q] Custom Key/Button Mapping ideas - Vibrant Q&A, Help & Troubleshooting

I come from a G1 where the Dialer, the End Call, and the Camera all had dedicated buttons. I feel like the Vibrant would be so much better if it had these. I'd like to develop an app or simply code something myself that we could flash as an update but I don't know where to start as I am not a developer though I wish I could be.
Pretty much this is how I would map everything:
Menu: Menu
(Long Press) = Dialer
Home: Home Screen
(Long Press) = Recent Applications
Back: Back
(Long Press) = End Call if making a call/Sleep if not in a call (Could possibly be Voice Search)
Search: Search Function
(Long Press) = End Call if making a call/Sleep if not in a call (Could possibly be Voice Search)
Power Button: Camera
(Long Press) = Power Options (Silent, Power Off, Reboot)
Note: If this is in the wrong section, I apologize and please move it. If you are a developer and like my idea, please to get to me as I'd like to work on it as a project. We could possibly sell it on the market and provide it for free for the people her on xda development.

It'd be awesome if they changed what the power button did when the camera app is up. It makes sense to lock the screen when in camcorder mode so you don't accidentally stop or pause it, but in camera mode it's essentially useless. It'd be awesome if it was changed to a shutter button even if it doesn't have the two stage button.

This phone would be so much better with just a few little modifications.

Related

[Q] Remap camera button

I'd like to remap the camera button to launch the voice recorder when suspended, but available as shutter button when in the camera app. Can this button be context sensitive like this?
I found a key mapping in the /system directory, and saw a keycode with the word CAMERA next to it. Is it just a matter of replacing CAMERA with the appropriate voice recorder binary?
Thanks!
I don't believe there is any context sensitivity - however, you can map the camera half-press to the shutter, and a full-press to a voice recorder?
I had to remap my half-press camera button to the "BACK" action when my capacitive "back" button broke on my streak. You'll have to get root, and afterwards you can modify /system/usr/keylayouts/{qwerty,surf}.kl I believe.
Key 52 is the halfpress I think.. 52, or 59. Dig around the .kl files and search for "FOCUS" and "CAMERA" to see which key IDs map that button.
btw, i grew up near/in cerritos from 1986-98. I miss that area very much, esp. during those times. /me waves
kertong said:
I don't believe there is any context sensitivity - however, you can map the camera half-press to the shutter, and a full-press to a voice recorder?
I had to remap my half-press camera button to the "BACK" action when my capacitive "back" button broke on my streak. You'll have to get root, and afterwards you can modify /system/usr/keylayouts/{qwerty,surf}.kl I believe.
Key 52 is the halfpress I think.. 52, or 59. Dig around the .kl files and search for "FOCUS" and "CAMERA" to see which key IDs map that button.
btw, i grew up near/in cerritos from 1986-98. I miss that area very much, esp. during those times. /me waves
Click to expand...
Click to collapse
Thanks! Am I right that I would replace that action with the binary name of the voice recorder? Or is it the apk name?
Wife said we "had"to move to Cerritos, so we did.
I have done this same thing.
It is very easy to do with the Tasker application.
I have set mine so that when im in the car (with my own car mode set on) that the camera button brings up a choice of the dialer, call log or contacts. yet it still functions perfectly when in the camera app.
the_didge said:
I have done this same thing.
It is very easy to do with the Tasker application.
I have set mine so that when im in the car (with my own car mode set on) that the camera button brings up a choice of the dialer, call log or contacts. yet it still functions perfectly when in the camera app.
Click to expand...
Click to collapse
Please describe step-by-step what you did! My ROM is 2.1 (o2), 8105 build.
I tried tasker but I dont see how to remap the Camera (FOCUS) button.
I changed an event (hardware - CAMERA Button) and added an action (load App) then applied.
The notification says, no profie activated? Why?
kertong said:
I don't believe there is any context sensitivity - however, you can map the camera half-press to the shutter, and a full-press to a voice recorder?
I had to remap my half-press camera button to the "BACK" action when my capacitive "back" button broke on my streak. You'll have to get root, and afterwards you can modify /system/usr/keylayouts/{qwerty,surf}.kl I believe.
Key 52 is the halfpress I think.. 52, or 59. Dig around the .kl files and search for "FOCUS" and "CAMERA" to see which key IDs map that button.
btw, i grew up near/in cerritos from 1986-98. I miss that area very much, esp. during those times. /me waves
Click to expand...
Click to collapse
Hey Kertong, needing to do same thing. Replaced my screen and keypad now only performs menu. I am in shell trying to find the right action. Can you describe what you edited the .kl to?
Option 1
2 apps combined together can remap camera
button remapper - remap camera to search fn
launcher key to set search to any app u want
Option 2
Use tasker
Tried Tasker, great program just couldn't get it to work right, but will be a great application when I get it all setup.
My resolution.
Instead of using applications...
I did 'adb shell'
went to /system/usr/keylayout
did 'vi surf_keypad.kl'
And edited key 212 which is Camera, with Back.
Although now the softpad doesn't function as Menu only. Atleast I can go back now.!
the_didge said:
I have done this same thing.
It is very easy to do with the Tasker application.
I have set mine so that when im in the car (with my own car mode set on) that the camera button brings up a choice of the dialer, call log or contacts. yet it still functions perfectly when in the camera app.
Click to expand...
Click to collapse
wyx said:
Please describe step-by-step what you did! My ROM is 2.1 (o2), 8105 build.
Click to expand...
Click to collapse
Seconded. Share!
http://forum.pocketables.net/showthread.php?t=9680

[IDEA] Vol +/- Key Intercept for added Menu/Back functionality

Just wondering about the feasibility of (someone with the know-how) creating a background app/service that could monitor and intercept the Nook's Vol+ and Vol- buttons, and if held down for a certain amount of time, perform Menu or Back actions as well.
I would think this possible, based on CM ROMs' ability to skip forwards/backwards from the lockscreen when music is playing, as well as the official XBMC Remote's abililty to change the volume for media playing on an XBMC box without interfering with the volume on the actual Android device.
Under the stock BN ROM I had remapped the Vol buttons, which wasn't a problem since the speaker was barely audible in the first place, but since flashing Dalingrin's OC kernel with the increased volume, I (happily) find the need to be able to change the volume levels easily.
I can't be the only one who's pondered this, but I've read through most of the threads and don't recall seeing this anywhere... If I've missed it, please point me in the right direction.
Thoughts? Takers?
Thanks.
You mean like this easily flashable script in the development forum (page 2).
http://forum.xda-developers.com/showthread.php?t=965023
I am talking an app which would retain volume functionality if the buttons are pressed briefly, as well as implement menu / back functions if held.
Unfortunately it looks like that script you linked to simply remaps the volume keys to menu and back -- without retaining volume functionality:
EpicFail236 said:
[...]
I find that my need for physical menu and back buttons is greater than my need for physical volume buttons.
[...]
This zip is CWM flashable, and simply overwrites the keymap kl files with ones that have the volume buttons remapped.
[...]
Click to expand...
Click to collapse
Not exactly what you want, but a simple solution.
see this, tip #7. Its a simple edit to a text file.
Worked on CM7, heres my edited /system/usr/keylayout/qwerty.kl vol up=menu, down=back
Thanks; unfortunately that is the essentially same as sparhawk's solution, and what I did under the BN ROM.
What I'm looking for is a solution via an application that retains the volume button functionality and augments the buttons with menu/back ability and does not simply remap the volume buttons.
If I had the slightest inkling as to how to do this myself, I would. Unfortunately I've tried and failed (miserably) so far at attempting to learn coding for Android.
I was hoping someone might be familiar with the way CM and XBMC Remote handle these intercepts and be able to adapt code, or create something similar for menu/back functionality.
I get what you are saying, but I don't think it would be possible. Notice how if you hold it down now, it will turn the volume down all the way step by step. When the screen is off, it doesn't do anything. If it was made to be held down to switch function, you would lose the ability to turn down the volume by holding it down. I know what I said is confusing, but just think about it lol. Have you thought about remapping tthe keys totally to menu/back, and then having a sound toggle in the pull down widget for the notification bar? You wouldn't have total control over the levels, but at least its something.
Sent from my ADR6300 using XDA App
Xephik said:
I get what you are saying, but I don't think it would be possible. Notice how if you hold it down now, it will turn the volume down all the way step by step. When the screen is off, it doesn't do anything.
Click to expand...
Click to collapse
I am running CM7 n11 on the nook, and regardless of whether the screen is on or off: if music is playing, when I hit the volume button, the volume level is changed. Not sure what you're referring to.
Xephik said:
If it was made to be held down to switch function, you would lose the ability to turn down the volume by holding it down.
Click to expand...
Click to collapse
I don't necessarily think that's the case.
Example: somehow CM is able to retain volume functionality and add skip next/previous track in music player. When I refer to the ability of CM to skip forward/backwards when music is playing, I am basing this on my experience with CM6.12 on my Droid1.
Xephik said:
Have you thought about remapping tthe keys totally to menu/back, and then having a sound toggle in the pull down widget for the notification bar? You wouldn't have total control over the levels, but at least its something.
Click to expand...
Click to collapse
Yeah, done that and didn't love it. I believe a solution such as I'm suggesting would be much more "integrated," elegant, and convenient.
Basically the app would intercept a volume button press:
- brief press: button release < 300ms, app performs volume function
- long press: button held down or release > 300ms, perform back or menu
Are there any experienced devs who provide some insight?
tj!2k7 said:
Thanks; unfortunately that is the essentially same as sparhawk's solution, and what I did under the BN ROM.
What I'm looking for is a solution via an application that retains the volume button functionality and augments the buttons with menu/back ability and does not simply remap the volume buttons.
If I had the slightest inkling as to how to do this myself, I would. Unfortunately I've tried and failed (miserably) so far at attempting to learn coding for Android.
I was hoping someone might be familiar with the way CM and XBMC Remote handle these intercepts and be able to adapt code, or create something similar for menu/back functionality.
Click to expand...
Click to collapse
I've seen this behavior to control the Android music player. And honesty I don't see why it couldn't be adapted to throw a back or home interrupt. But to implement it is beyond me!
Here is a GitHub repo to handle the Android player on long press up and down but also still handle volume changes on short press.
https://github.com/metalhead8816/android_frameworks_policies_base
And I'm pretty sure the specific commit would be
https://github.com/metalhead8816/an...mmit/7504617a9211a65ce767281c59668e8641b8a14d
Mat Sumpter said:
Here is a GitHub repo to handle the Android player on long press up and down but also still handle volume changes on short press.
https://github.com/metalhead8816/android_frameworks_policies_base
And I'm pretty sure the specific commit would be
https://github.com/metalhead8816/an...mmit/7504617a9211a65ce767281c59668e8641b8a14d
Click to expand...
Click to collapse
We're on a better path now. Thank you for posting concrete evidence of the volume buttons serving two simultaneous functions.
Could that code be used as a base for a standalone background app/service to implement the desired functionality? Better yet if it could be built into a ROM such as CM, but a standalone app would be perfect.
As this is really a question for devs, should I have posted this thread in the dev forum?
This code was put in for eclair so it won't apply cleanly to the Froyo code. But I'm sure a DEV with good Java knowledge could hack this into the current policy framework. From the code this appears pretty integral so I doubt this could be an outside apk that we install. This would likely be an alternate framework we'd need to apply to a ROM much like a style. But again I'm not an Android developer so I don't know for sure.
Button remapper works for the simple remapping, but not for the longpress actions.
I have half a mind to attempt writing a simple service for this
long press menu->vol up in 20% increments
long press back->vol down in 20% increments (may interfere with CM7 long press to kill functionality)
http://android-developers.blogspot.com/2009/12/back-and-other-hard-keys-three-stories.html
http://stackoverflow.com/questions/4983605/send-button-volume-button-action-listeners
http://developer.android.com/reference/android/view/KeyEvent.html
A service sounds (to a non-programmer such as myself) like it would be less involved than framework modifications, and portable across ROM updates.
And personally, I don't mind "losing" long-press-kill functionality as I never use it anyway... I'd love to see some progress along these lines... go for it. =)
If you decide to attempt create a service for this, could you be make the long/short actions customizable?
i.e. :
Short press Vol+: Volume up / Long-press Vol+: Menu
Short press Vol-: Volume down / Long-press Vol-: Back
vs.
Short press Vol+: Menu / Long-press Vol+: Volume up
Short press Vol-: Back / Long-press Vol-: Volume down
In most applications, Menu and Back are usable via the status bar; since that functionality would be redundant, it would be nice to retain quick access to volume for short presses. For instances where Menu and Back are not usable in full-screen applications, long-pressing the buttons to perform menu and back actions doesn't seem like much of an issue.
Actually, if the Menu and Back were long-press actions, couldn't you implement functionality to kill the current app if Back was held for a specific amount of time?
Just thought I'd bump this back to the top... any devs out there who might want to take a crack at something like this?
Until we get Honeycomb AOSP this "hack" would be perfect!
I'm on the lookout too. I'd much rather have my vol up and down keys then have them as back and home. Unfortunately I lack the skills to code it so far!
My prayers, answered. Thanks mad-murdock.
http://forum.xda-developers.com/showthread.php?t=1002000&page=23

[Q] Re-Map camera shutter button?

I'm not sure if someone has posted this already or what not, but basically I wanted to know if it would be possible to remap the dedicated camera button for another function. I ask because, i prefer using the onscreen camera shutter to take pictures and i'm sure other people do as well. Just a though for anyone with the ability to make it happen. I posted it here because i figured that, even though its a question, it's application related.
well personally, i would like to see an option to keep the camera button for the camera function but just make the button wake the phone as well.
polo79 said:
well personally, i would like to see an option to keep the camera button for the camera function but just make the button wake the phone as well.
Click to expand...
Click to collapse
Or that. An app like launch key that let's you select it would be cool.
You can remap the camera button to do other things, but your choices are limited afaik. I have my camera button remapped so that the half press takes a picture, and a full press acts as a power button. The power function allows it to turn the screen on or off, and I still have camera functionality from it.
I am unable to keep the original camera functions and have it wake the phone, it just wont allow it. It's been that way as long as I can remember trying, starting with the Hero on 1.5
To remap the camera hard key, or any other hard key for that matter, you have to edit the shooter-keypad.kl file located in /system/usr/keylayout
You can go in and edit it with Root Explorer pretty easy, reboot when finished for changes to take effect. I will look real quick and see what all function are available for us to use with this, but I know that I cannot make it launch an app. There was some extensive work done on this in the Hero dev forum a while back, but I think it died off when it was still a WIP for exp devs only. Maybe someone with some real knowledge of this can chime in here.
This is what my shooter-keypad.kl looks like:
Code:
key 116 POWER WAKE_DROPPED
key 114 VOLUME_DOWN WAKE
key 115 VOLUME_UP WAKE
key 102 HOME
key 139 MENU
key 158 BACK
key 217 SEARCH
key 107 ENDCALL WAKE_DROPPED
# LCM 2D/3D switch
key 193 FUNC_2
key 194 FUNC_1
# CAMERA
key 211 CAMERA
key 212 POWER WAKE_DROPPED
And this is stock:
Code:
key 116 POWER WAKE_DROPPED
key 114 VOLUME_DOWN WAKE
key 115 VOLUME_UP WAKE
key 102 HOME
key 139 MENU
key 158 BACK
key 217 SEARCH
key 107 ENDCALL WAKE_DROPPED
# LCM 2D/3D switch
key 193 FUNC_2
key 194 FUNC_1
# CAMERA
key 211 FOCUS
key 212 CAMERA
So, I played around a bit more, here are the functions that I know of that can be set to the camera hard key, either half press or full press. I noted on some that I tested what they are capable of.
Just so it's clear assigning WAKE_DROPPED to a function asks it to wake the phone if possible. WAKE asks it to complete it's task w/o waking the phone, and if there's nothing there, the function will not be enabled unless the phone is awake and unlocked. Also, key 211 is half press and key 212 is full press of the camera hard key.
Best thing I found that some people may want to use, FOCUS can wake the phone. So you can give FOCUS the WAKE_DROPPED ability, and it will turn the screen on. Down side is that it is so easy to press, if you carry ur phone in ur pocket like I do, this could be a battery killer. But, this does retain all normal button functionality and allows it to wake the phone.
Something else interesting, you can set half press to DPAD_RIGHT and full press to DPAD_LEFT. This lets you use the camera button to scroll left and right while typing or while in the browser, which can be very handy on some web pages with small text links. Or for people with fat fingers.
If anyone wants to do this, but has some trouble with it, post up and I can attach a modified keypad file for you to use.
Code:
POWER (Can wake phone, does not function as POWER once phone if off)
VOLUME_DOWN (Cannot wake phone)
VOLUMN_UP (Cannot wake phone)
HOME (Can wake phone)
MENU
BACK
SEARCH
ENDCALL
FUNC_2 (2D ON)
FUNC_1 (3D ON)
FOCUS (Can wake phone)
CAMERA (Cannot wake phone)
GRAVE (Can wake phone, and launches Search)
DPAD_CENTER
DPAD_UP
DPAD_DOWN
DPAD_LEFT
DPAD_RIGHT
ENDCALL (Can wake phone)
MUTE
CALL (Can wake phone)
MEDIA_NEXT (Cannot wake phone)
MEDIA_PLAY_PAUSE (Cannot wake phone)
MEDIA_PREVIOUS (Cannot wake phone)
MEDIA_REWIND (Cannot wake phone)
MEDIA_FAST_FORWARD (Cannot wake phone)
VOLUME_UP (Cannot wake phone)
VOLUME_DOWN (Cannot wake phone)
this app does it as well as other options .. i use it !
iTouch24 said:
this app does it as well as other options .. i use it !
Click to expand...
Click to collapse
U sure it works with the EVO 3D coz the developer in his description says the app doesn't work with HTC sense UI.
iTouch24 said:
this app does it as well as other options .. i use it !
Click to expand...
Click to collapse
Mini rant on...
Like Pr20 suggested, this app does not work on the camera button with HTC Sense. Why would you suggest an app without having used it yourself, or why are you in a forum for a phone you don't have. I figure it's gotta be one of those, otherwise you would know that that app doesn't work with HTC. Never has since it came out, it's in the market description even.
... rant off
Anyway, I've spent some time with the focus function having waking abilities, and it's pretty nice. The camera functions like normal, and a half press will wake the phone. But, there are some oddities that actually make it a little nicer for practical use. If your screen is turned off, and then the camera button is pressed within 20 seconds, the screen will come back on. If the screen is off for more then 20 seconds, the camera button has to be pressed twice in quick succession in order to wake the phone, sometimes 3 times. I'm not sure what causes this, but it's very nice, as it prevents a lot of accidental pockets wakes/dials.
UMMM ... i have the application and it does work with launching applications with camera button ...
regardless what it says ...
it probably has issues with some htc sense ui phones but i got the evo 3d and i have the market launch with camera button and quickdial launch with selecting and holding down search button
buy it and see for yourself ... u can return in 15 minutes ... that is more then enough time to see if it works ... and i am using it and it works fine ...
HTC SENSE UI:
--------------------
Launching from the Camera button may not work for users with the HTC Sense UI. Unfortunately HTC is unwilling to work with me to resolve the issue.
maybe because my phone is rooted ???
next time u want to rant be certain and dont assume ... i said in my post that i USE IT ... and i know i posted in the HTC EVO 3d, the current phone that i have
dam u try and help people .. and look ....
iTouch24 said:
UMMM ... i have the application and it does work with launching applications with camera button ...
regardless what it says ...
it probably has issues with some htc sense ui phones but i got the evo 3d and i have the market launch with camera button and quickdial launch with selecting and holding down search button
buy it and see for yourself ... u can return in 15 minutes ... that is more then enough time to see if it works ... and i am using it and it works fine ...
HTC SENSE UI:
--------------------
Launching from the Camera button may not work for users with the HTC Sense UI. Unfortunately HTC is unwilling to work with me to resolve the issue.
maybe because my phone is rooted ???
next time u want to rant be certain and dont assume ... i said in my post that i USE IT ... and i know i posted in the HTC EVO 3d, the current phone that i have
dam u try and help people .. and look ....
Click to expand...
Click to collapse
I have bought it, and I have used it before, and it doesn't work with the camera button on any ROM I have used. I'm hesitant to believe you that it works. That App has been around a while and I have used it before with other phones. I wish it did work, and but it certainly doesn't on my phone.
So, I don't know if ur just full of bs, or somehow ur phone runs different then the two I have access to, and but either way, I'm not going to worry about it.
Sent from my 3D EVOlution

[Suggestion] Multitasking Button remap (HOX & GS3)

I havent really seen anyone do or suggest this, but for those making roms for the HTC One series, could you re-re-map the hardware buttons so that the recent apps button pulls up the recent apps (normal ics behavior), and then a long press on the recent apps button maps to the menu button?
My reasoning, is eventually, the "menu" button is something that will get obsoleted, so mapping it as a secondary action (i.e. long press) is a better approach than the current mapping on some of the Roms out there (like cm9). Personally, I'm not a fan of long-presses, so I prefer it for functions I hardly use (like menu).
As for the Gs3, I recommend mapping the 'menu' button to the 'recent apps', and a long press to the menu function (instead of long pressing the home button for recent apps). Again, my reasoning is, when the menu button, eventually gets obsoleted, it becomes pointless having the physical menu button do nothing.
Anyway, just my 2 cents...
Bump.
What I know is that single click functionality of any button can be changed by editing system/usr/keylayout/something_keypad.kl
But long press is not related to button remapping... So it needs to be changed from somewhere else and about that I have no idea..
Sent from my GT-S7500 using xda premium

Can I make the volume button into a power button?

I've got the "side key" set to be a power button, but every fiber of my being believes the power button is the one on top. Is there any way I can make the volume up button act as a power button?
You will adapt...
Yeah I think you can do that... saw a remapping apk or that option somewhere.
Problem is it may come back to haunt you; follow the KISS protocol whenever possible.
Those buttons serve some important functions especially when you're having major problems.
Probably a bad idea to alter the button layout that much... after a couple weeks it becomes automatic, more or less
You may find the Galaxy Store app One Handed Operation Plus useful to add more virtual switches.

Categories

Resources