Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
undrwater
Old
#1  
undrwater's Avatar
Senior Member - OP
Thanks Meter 9
Posts: 146
Join Date: Aug 2010
Location: Cerritos
Default [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!
 
kertong
Old
#2  
Member
Thanks Meter 1
Posts: 56
Join Date: Apr 2007
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
 
undrwater
Old
#3  
undrwater's Avatar
Senior Member - OP
Thanks Meter 9
Posts: 146
Join Date: Aug 2010
Location: Cerritos
Quote:
Originally Posted by kertong View Post
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

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.
 
the_didge
Old
#4  
Member
Thanks Meter 2
Posts: 57
Join Date: Mar 2010
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.
 
wyx
Old
#5  
Member
Thanks Meter 0
Posts: 72
Join Date: Dec 2006
Quote:
Originally Posted by the_didge View Post
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.
Please describe step-by-step what you did! My ROM is 2.1 (o2), 8105 build.
 
wyx
Old
(Last edited by wyx; 23rd October 2010 at 10:56 PM.)
#6  
Member
Thanks Meter 0
Posts: 72
Join Date: Dec 2006
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?
 
RussellAlan
Old
#7  
Member
Thanks Meter 3
Posts: 42
Join Date: Sep 2009
Quote:
Originally Posted by kertong View Post
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
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?
 
drgopoos
Old
#8  
Senior Member
Thanks Meter 466
Posts: 2,304
Join Date: Jul 2007
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
 
RussellAlan
Old
#9  
Member
Thanks Meter 3
Posts: 42
Join Date: Sep 2009
Tried Tasker, great program just couldn't get it to work right, but will be a great application when I get it all setup.
 
RussellAlan
Old
#10  
Member
Thanks Meter 3
Posts: 42
Join Date: Sep 2009
Default 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.!

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Side-Swiping Multitasking with Kakudo

Recovering iPad users may still remember the multitasking function where you can swipe left or right to … more

Learn to Edit Graphics for your Development Work

The importance of good and appropriate graphics for your development work is undeniable. Be … more

Tasker Alternative: AutomateIt, Automates Your Device Tasks – XDA Developer TV

XDA Developer TV Producer Kevin wants to help make your … more

Preventing App Piracy: Join the Discussion

The topic of piracy is always a touchy subject, but I feel that the grass roots style of Android … more