Example usage for android.view KeyEvent FLAG_KEEP_TOUCH_MODE

List of usage examples for android.view KeyEvent FLAG_KEEP_TOUCH_MODE

Introduction

In this page you can find the example usage for android.view KeyEvent FLAG_KEEP_TOUCH_MODE.

Prototype

int FLAG_KEEP_TOUCH_MODE

To view the source code for android.view KeyEvent FLAG_KEEP_TOUCH_MODE.

Click Source Link

Document

This mask is set if we don't want the key event to cause us to leave touch mode.

Usage

From source file:com.tct.mail.ui.AbstractActivityController.java

@Override
public final boolean onKeyDown(int keyCode, KeyEvent event) {
    //[FRETURE]-ADD-BEGIN by TSNJ.wei huang 11/24/2014 FR848855
    if (keyCode == event.KEYCODE_BACK) {
        if (mCabActionMenu != null) {
            if (mCabActionMenu.isActivated()) {
                if (mCabActionMenu.isActionModeNull()) {
                    return false;
                } else {
                    mCabActionMenu.onSetEmpty();
                }/*from   www . j  a v  a 2  s  .  c o m*/
                return true;
            } else {
                return false;
            }
        }
    }
    //[FEATURE]-ADD-END by TSNJ.wei huang

    // TS: gangjin.weng 2015-4-5 EMAIL BUGFIX-968391 ADD_S
    if (keyCode == KeyEvent.KEYCODE_DEL && mCabActionMenu == null && event != null && event.getScanCode() == 0
            && event.getMetaState() == 0
            && event.getFlags() == (KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE)) {
        return true;
    }
    // TS: gangjin.weng 2015-4-5 EMAIL BUGFIX-968391 ADD_E
    return false;
}