Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[HOWTO] Remap hardware button to ICS recent apps

OP evilisto

17th January 2012, 07:46 AM   |  #1  
evilisto's Avatar
OP Senior Member
Thanks Meter: 2,349
 
486 posts
Join Date:Joined: Nov 2010


this is simple howto about this mod.. : [MOD] Search key to ICS recent apps


1) change source code related to APP_SWITCH keycode.

platform/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

from :
Code:
        } else if (keyCode == KeyEvent.KEYCODE_APP_SWITCH) {
            if (down && repeatCount == 0) {
                showOrHideRecentAppsDialog(RECENT_APPS_BEHAVIOR_SHOW_OR_DISMISS);
            }
            return -1;
        }

to :
Code:
        } else if (keyCode == KeyEvent.KEYCODE_APP_SWITCH) {
            if (down && repeatCount == 0 && !keyguardOn) {
            try {
                mStatusBarService.toggleRecentApps();
            } catch (RemoteException e) {
                Slog.e(TAG, "RemoteException when showing recent apps", e);
            }
        }
            return -1;
        }

2) edit your keylayout files..

/system/usr/keylayout/

for example, if you want to use search key to recent apps on nexus s...

cypress-touchkey.kl
Code:
key 139    MENU           VIRTUAL
key 102    HOME           VIRTUAL
key 158    BACK           VIRTUAL
key 217    APP_SWITCH     VIRTUAL
and mxt224_ts_input.kl (it would be better to edit both files..)
Code:
key 158   BACK              WAKE
key 139   MENU              WAKE
key 217   APP_SWITCH        WAKE
key 102   HOME              WAKE

3) done

---------------------------------------------------------------------------------------------------

- and if you cannot compile android.policy.jar for some reason, try with my files instead.
you can find my files in these thread :
[MOD] Search key to ICS recent apps
[MOD] Add ICS 'Recent Apps' button to Status bar
and be careful. you should use suitable version to your rom. so if your cm9 rom was built few weeks ago, do not try with latest version of my mod.
Last edited by evilisto; 21st March 2012 at 08:44 PM. Reason: update
The Following 18 Users Say Thank You to evilisto For This Useful Post: [ View ]
17th January 2012, 10:16 AM   |  #2  
etoy's Avatar
Senior Member
Thanks Meter: 516
 
1,537 posts
Join Date:Joined: Dec 2009
More
dumb question, but what does originally the "APP_SWITCH" action do without the java change?
17th January 2012, 07:19 PM   |  #3  
Member
Thanks Meter: 3
 
95 posts
Join Date:Joined: Jan 2007
More
It brings up a recent apps window that looks like the original switcher from 1.5.

For OP, does this still mess up the other key functions that you said in your other thread?
Last edited by thejaredhuang; 17th January 2012 at 07:26 PM.
17th January 2012, 08:58 PM   |  #4  
evilisto's Avatar
OP Senior Member
Thanks Meter: 2,349
 
486 posts
Join Date:Joined: Nov 2010
Quote:
Originally Posted by etoy

dumb question, but what does originally the "APP_SWITCH" action do without the java change?

that will bring old version app switcher.

Quote:
Originally Posted by thejaredhuang

For OP, does this still mess up the other key functions that you said in your other thread?

if you use proper version for your rom(currently stock, cm9 and aokp), key problems will not happen. but that will happen on other roms like peter alfonso's ics..
17th January 2012, 11:03 PM   |  #5  
jerkysh's Avatar
Senior Member
Flag Chisinau
Thanks Meter: 180
 
495 posts
Join Date:Joined: Feb 2011
More
where the hell is this direction?
platform/frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java , i would love to try this mod on my cappy, to see if it works
17th January 2012, 11:32 PM   |  #6  
Smasher816's Avatar
Senior Member
Flag Missouri
Thanks Meter: 166
 
391 posts
Join Date:Joined: Jan 2011
Donate to Me
More
Its in the android source code...
Someone needs to make a modded rom based on that (ex a cm9 kang).
17th January 2012, 11:53 PM   |  #7  
RaptorOne3's Avatar
Senior Member
Thanks Meter: 30
 
257 posts
Join Date:Joined: Dec 2010
More
If you don't mind me asking, what is the significance of this?

Long pressing the "Home" capacitive key brings up the "Recent Apps" screen... Why change it?

Forgive my short sighted confusion, but I just don't understand why you want your search button to bring up the Recent Apps screen when the home button already does it...

18th January 2012, 12:06 AM   |  #8  
nonione's Avatar
Senior Member
S.S.
Thanks Meter: 164
 
592 posts
Join Date:Joined: Aug 2009
More
cause its faster just like in the GN you only tap and theres your multitask
18th January 2012, 02:17 AM   |  #9  
Member
Thanks Meter: 3
 
95 posts
Join Date:Joined: Jan 2007
More
Quote:
Originally Posted by RaptorOne3

If you don't mind me asking, what is the significance of this?

Long pressing the "Home" capacitive key brings up the "Recent Apps" screen... Why change it?

Forgive my short sighted confusion, but I just don't understand why you want your search button to bring up the Recent Apps screen when the home button already does it...

If you've ever used webOS you'll understand how frustrating it is to hold the Home button down for 2 seconds.

I would be bagging on Android for copying webOS but in the end its the same person who designed it.
18th January 2012, 03:10 AM   |  #10  
qtwrk's Avatar
Senior Member
Flag Barcelona
Thanks Meter: 815
 
2,509 posts
Join Date:Joined: Sep 2011
More
this is great , i have my nexus s for 5 moths and almost never use SEARCH BUTTON..., problem is , i am using KANGY by HAKA, ok , this is not the issue

but i also applied http://forum.xda-developers.com/show....php?t=1439681 this MOD .... that brings me a problem ...

and i don't have access to source code of this MOD , how am i supposed to do it ?

Post Reply Subscribe to Thread

Tags
ics button recent multitask swicher
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes