本文整理汇总了Java中android.text.method.MetaKeyKeyListener.handleKeyDown方法的典型用法代码示例。如果您正苦于以下问题:Java MetaKeyKeyListener.handleKeyDown方法的具体用法?Java MetaKeyKeyListener.handleKeyDown怎么用?Java MetaKeyKeyListener.handleKeyDown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.text.method.MetaKeyKeyListener
的用法示例。
在下文中一共展示了MetaKeyKeyListener.handleKeyDown方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onKeyDown
import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if (!m_started)
return false;
m_metaState = MetaKeyKeyListener.handleKeyDown(m_metaState, keyCode, event);
int c = event.getUnicodeChar(MetaKeyKeyListener.getMetaState(m_metaState));
int lc=c;
m_metaState = MetaKeyKeyListener.adjustMetaAfterKeypress(m_metaState);
if ((c & KeyCharacterMap.COMBINING_ACCENT) != 0)
{
c = c & KeyCharacterMap.COMBINING_ACCENT_MASK;
int composed = KeyEvent.getDeadChar(m_lastChar, c);
c = composed;
}
m_lastChar = lc;
// if (keyCode != KeyEvent.KEYCODE_BACK)
QtApplication.keyDown(keyCode, c, event.getMetaState());
return true;
}
示例2: translateKeyDown
import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
/**
* This translates incoming hard key events in to edit operations on an
* InputConnection. It is only needed when using the
* PROCESS_HARD_KEYS option.
*/
private boolean translateKeyDown(int keyCode, KeyEvent event) {
mMetaState = MetaKeyKeyListener.handleKeyDown(mMetaState,
keyCode, event);
int c = event.getUnicodeChar(MetaKeyKeyListener.getMetaState(mMetaState));
mMetaState = MetaKeyKeyListener.adjustMetaAfterKeypress(mMetaState);
InputConnection ic = getCurrentInputConnection();
if (c == 0 || ic == null) {
return false;
}
boolean dead = false;
if ((c & KeyCharacterMap.COMBINING_ACCENT) != 0) {
dead = true;
c = c & KeyCharacterMap.COMBINING_ACCENT_MASK;
}
if (mComposing.length() > 0) {
char accent = mComposing.charAt(mComposing.length() -1 );
int composed = KeyEvent.getDeadChar(accent, c);
if (composed != 0) {
c = composed;
mComposing.setLength(mComposing.length()-1);
}
}
onKey(c, null);
return true;
}
示例3: translateKeyDown
import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
/**
* This translates incoming hard key events in to edit operations on an
* InputConnection. It is only needed when using the
* PROCESS_HARD_KEYS option.
*/
private boolean translateKeyDown(int keyCode, KeyEvent event) {
// Log.v("SpartacusRex","SOFT : translateKeyDown "+keyCode);
mMetaState = MetaKeyKeyListener.handleKeyDown(mMetaState,
keyCode, event);
int c = event.getUnicodeChar(MetaKeyKeyListener.getMetaState(mMetaState));
mMetaState = MetaKeyKeyListener.adjustMetaAfterKeypress(mMetaState);
InputConnection ic = getCurrentInputConnection();
if (c == 0 || ic == null) {
return false;
}
boolean dead = false;
if ((c & KeyCharacterMap.COMBINING_ACCENT) != 0) {
dead = true;
c = c & KeyCharacterMap.COMBINING_ACCENT_MASK;
}
if (mComposing.length() > 0) {
char accent = mComposing.charAt(mComposing.length() - 1);
int composed = KeyEvent.getDeadChar(accent, c);
if (composed != 0) {
c = composed;
mComposing.setLength(mComposing.length() - 1);
}
}
onKey(c, null);
return true;
}
示例4: translateKeyDown
import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
/**
* This translates incoming hard key events in to edit operations on an
* InputConnection. It is only needed when using the
* PROCESS_HARD_KEYS option.
*/
private boolean translateKeyDown(int keyCode, KeyEvent event) {
mMetaState = MetaKeyKeyListener.handleKeyDown(mMetaState,
keyCode, event);
int c = event.getUnicodeChar(MetaKeyKeyListener.getMetaState(mMetaState));
mMetaState = MetaKeyKeyListener.adjustMetaAfterKeypress(mMetaState);
InputConnection ic = getCurrentInputConnection();
if (c == 0 || ic == null) {
return false;
}
boolean dead = false;
if ((c & KeyCharacterMap.COMBINING_ACCENT) != 0) {
dead = true;
c = c & KeyCharacterMap.COMBINING_ACCENT_MASK;
}
if (mComposing.length() > 0) {
char accent = mComposing.charAt(mComposing.length() -1 );
int composed = KeyEvent.getDeadChar(accent, c);
if (composed != 0) {
c = composed;
mComposing.setLength(mComposing.length()-1);
}
}
onKey(c, null);
return true;
}
示例5: translateKeyDown
import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
/**
* This translates incoming hard key events in to edit operations on an
* InputConnection. It is only needed when using the
* PROCESS_HARD_KEYS option.
*/
private boolean translateKeyDown(int keyCode, KeyEvent event) {
// Log.v("SpartacusRex","SOFT : translateKeyDown "+keyCode);
mMetaState = MetaKeyKeyListener.handleKeyDown(mMetaState,
keyCode, event);
int c = event.getUnicodeChar(MetaKeyKeyListener.getMetaState(mMetaState));
mMetaState = MetaKeyKeyListener.adjustMetaAfterKeypress(mMetaState);
InputConnection ic = getCurrentInputConnection();
if (c == 0 || ic == null) {
return false;
}
boolean dead = false;
if ((c & KeyCharacterMap.COMBINING_ACCENT) != 0) {
dead = true;
c = c & KeyCharacterMap.COMBINING_ACCENT_MASK;
}
if (mComposing.length() > 0) {
char accent = mComposing.charAt(mComposing.length() -1 );
int composed = KeyEvent.getDeadChar(accent, c);
if (composed != 0) {
c = composed;
mComposing.setLength(mComposing.length()-1);
}
}
onKey(c, null);
return true;
}
示例6: translateKeyDown
import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
private boolean translateKeyDown(int keyCode, KeyEvent event) {
MetaState = MetaKeyKeyListener.handleKeyDown(MetaState,
keyCode, event);
int c = event.getUnicodeChar(MetaKeyKeyListener.getMetaState(MetaState));
MetaState = MetaKeyKeyListener.adjustMetaAfterKeypress(MetaState);
InputConnection ic = getCurrentInputConnection();
if (c == 0 || ic == null) {
return false;
}
dead = false;
if ((c & KeyCharacterMap.COMBINING_ACCENT) != 0) {
dead = true;
c = c & KeyCharacterMap.COMBINING_ACCENT_MASK;
}
if (Composing.length() > 0) {
char accent = Composing.charAt(Composing.length() -1 );
int composed = KeyEvent.getDeadChar(accent, c);
if (composed != 0) {
c = composed;
Composing.setLength(Composing.length()-1);
}
}
onKey(c, null);
return true;
}
示例7: getUnicodeChar
import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
private int getUnicodeChar(int keyCode, KeyEvent event) {
mMetaState = MetaKeyKeyListener.handleKeyDown(mMetaState, keyCode, event);
int c = event.getUnicodeChar(MetaKeyKeyListener.getMetaState(mMetaState));
mMetaState = MetaKeyKeyListener.adjustMetaAfterKeypress(mMetaState);
return c;
}
示例8: getUnicodeChar
import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
private int getUnicodeChar(int keyCode, KeyEvent event) {
metaState = MetaKeyKeyListener.handleKeyDown(metaState, keyCode, event);
int c = event.getUnicodeChar(event.getMetaState());
metaState = MetaKeyKeyListener.adjustMetaAfterKeypress(metaState);
return c;
}