Java Code Examples for android.view.KeyEvent#KEYCODE_SOFT_LEFT

The following examples show how to use android.view.KeyEvent#KEYCODE_SOFT_LEFT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MyEditText.java    From CoolChat with Apache License 2.0 5 votes vote down vote up
@Override
public boolean dispatchKeyEventPreIme(KeyEvent event) {
    if (event.getAction() == KeyEvent.KEYCODE_SOFT_LEFT) {
        LogUtils.e("dispatchKeyEventPreIme", "按下了返回键");
        if (mOnCancelInputLayout != null) {
            mOnCancelInputLayout.onCancelInputLayout();
        }
        return false;
    }
    return super.dispatchKeyEventPreIme(event);
}
 
Example 2
Source File: Lock.java    From Pi-Locker with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {

	return keyCode == KeyEvent.KEYCODE_HOME
			|| keyCode == KeyEvent.KEYCODE_BACK
			|| keyCode == KeyEvent.KEYCODE_APP_SWITCH
			|| keyCode == KeyEvent.KEYCODE_SOFT_LEFT
			|| keyCode == KeyEvent.KEYCODE_SOFT_RIGHT;
	
}