Java tutorial
//package com.java2s; //License from project: Open Source License import android.view.KeyEvent; public class Main { public static boolean canUseKey(int keyCode) { return ((keyCode != KeyEvent.KEYCODE_BACK) && (keyCode != KeyEvent.KEYCODE_HOME) && (keyCode != KeyEvent.KEYCODE_MENU) && (keyCode != KeyEvent.KEYCODE_ENDCALL)); } }