Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8775893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:55:06+00:00 2026-06-13T18:55:06+00:00

I’m working on an input device that has a button that I’d like to

  • 0

I’m working on an input device that has a button that I’d like to act both as a home button when pressed by itself, but also work as a modifier for the other buttons on the device.

I know you can do this in the kcm file with other buttons, and have something like:

key ESCAPE {
    base:                               fallback BACK
    alt, meta:                          fallback HOME
    ctrl:                               fallback MENU
}

Is it possible to have something like:

key CTRL_LEFT {
    base:                               fallback HOME
    {SOMETHING HERE}:                   CTRL_LEFT
}

so that I can press that button with another button and have it not fallback on HOME?

Thanks in advance! 😀

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:55:08+00:00Added an answer on June 13, 2026 at 6:55 pm

    This functionality is not possible on a system level: see
    http://source.android.com/tech/input/key-character-map-files.html for a list of all options possible.

    However, if you would like to have it on an application level, you could program it in as follows:

    import android.view.KeyEvent;
    
    private boolean home = false;
    
    public boolean onKeyDown(int keyCode, KeyEvent event) 
    {
       if (event.getScanCode() == 29)        //29 == CTRL_LEFT
         home = true;        //if we release this button, HOME needs to be invoked
       else home = false;    //so CTRL_LEFT was used as a modifier: no need to invoke HOME
    
       //allow the system to pass key handling to the next listener
       return super.onKeyUp(keyCode, event);
    }
    
    public boolean onKeyUp(int keyCode, KeyEvent event)
    {
       if (event.getScanCode() == 29 && home == true)
       {
         super.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_HOME));
         return true;        //so we absorb the event
       }
       return super.onKeyUp(keyCode, event);
    }
    

    Then, as long as this application is set up to receive the keystrokes (usually a privacy issue unless you’re coding it in for yourself), it can process the keystrokes and dispatch the HOME button when need be.

    Should you decide to proceed thus, you’d have to remove the

    base:                               fallback HOME
    

    from your code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I need to clean up various Word 'smart' characters in user input, including but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.