Example usage for android.view KeyEvent KEYCODE_SWITCH_CHARSET

List of usage examples for android.view KeyEvent KEYCODE_SWITCH_CHARSET

Introduction

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

Prototype

int KEYCODE_SWITCH_CHARSET

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

Click Source Link

Document

Key code constant: Switch Charset modifier key.

Usage

From source file:com.ichi2.anki.AbstractFlashcardViewer.java

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    // Hardware buttons for scrolling
    if (keyCode == KeyEvent.KEYCODE_PAGE_UP) {
        mCard.pageUp(false);//ww w .j ava  2 s. c  o  m
        if (mDoubleScrolling) {
            mCard.pageUp(false);
        }
        return true;
    }
    if (keyCode == KeyEvent.KEYCODE_PAGE_DOWN) {
        mCard.pageDown(false);
        if (mDoubleScrolling) {
            mCard.pageDown(false);
        }
        return true;
    }
    if (mScrollingButtons && keyCode == KeyEvent.KEYCODE_PICTSYMBOLS) {
        mCard.pageUp(false);
        if (mDoubleScrolling) {
            mCard.pageUp(false);
        }
        return true;
    }
    if (mScrollingButtons && keyCode == KeyEvent.KEYCODE_SWITCH_CHARSET) {
        mCard.pageDown(false);
        if (mDoubleScrolling) {
            mCard.pageDown(false);
        }
        return true;
    }
    return super.onKeyDown(keyCode, event);
}