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

  • SEARCH
  • Home
  • 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 8929143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:36:30+00:00 2026-06-15T08:36:30+00:00

I am using cocos2dx to make a small game and in the activity of

  • 0

I am using cocos2dx to make a small game and in the activity of my game i give the following functions to handle back button.

@Override
 public boolean onKeyDown(int keyCode, KeyEvent event)
 {
     return super.onKeyDown(keyCode, event);
 }

 @Override
 public void onDestroy()
 {
     android.os.Process.killProcess(android.os.Process.myPid());
     super.onDestroy();
 }

On pressing back button i get the following warning in my logcat

Can’t open keycharmap file

Error loading keycharmap file ‘/system/usr/keychars/qtouch-touchscreen.kcm.bin’. hw.keyboards.65538.devname=’qtouch-touchscreen’

The call doesn’t reach onKeyDown or onDestroy functions.

Please tell me why this warning is caused and why i cannot handle the android back button.

The functions work fine on my java android project but not in my cocos2d-x project

  • 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-15T08:36:31+00:00Added an answer on June 15, 2026 at 8:36 am

    It is been handled here in the file Cocos2dxGLSurfaceView.java

    change it to below, where myActivity is the cocos2dActicity

            case KeyEvent.KEYCODE_BACK:
                        AlertDialog ad = new AlertDialog.Builder(myActivity)
                        .setTitle("EXIT?")
                        .setMessage("Do you really want to exit?")
                        .setPositiveButton("YES", new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int which) {
                                ((Cocos2dxActivity)myActivity).finish();
                            }
                        })
                        .setNegativeButton("NO", new DialogInterface.OnClickListener() {
                            public void onClick(DialogInterface dialog, int which) {
    
                            }
                        }).create();
                        ad.show();
                return true;
            case KeyEvent.KEYCODE_MENU:
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using C++ string functions in cocos2dx. I have the following string CorrectAns
I am quite new in programming and aspiring to make a game using cocos2dx
I am writing a small game by using cocos2d. It is a shooting game.
In a game I'm starting to make using cocos2d, I have a subclass of
In my iPhone game (I am using cocos2d, shouldn't make a massive difference) I
I'm using cocos2d to make a game and I'm trying to create a shot
In my game, which is done for both Android and IOS using cocos2dx ,
I'm using Cocos2D, or more specifically Cocos2D-x to make a platformer-shooter game. I already
It is possible to make a multiplayer browser based game using cocos2d-javascript + node.js?
i try to make a tracing finger game using cocos2d. i move my finger

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.