本文整理汇总了Java中android.text.method.MetaKeyKeyListener.adjustMetaAfterKeypress方法的典型用法代码示例。如果您正苦于以下问题:Java MetaKeyKeyListener.adjustMetaAfterKeypress方法的具体用法?Java MetaKeyKeyListener.adjustMetaAfterKeypress怎么用?Java MetaKeyKeyListener.adjustMetaAfterKeypress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.text.method.MetaKeyKeyListener
的用法示例。
在下文中一共展示了MetaKeyKeyListener.adjustMetaAfterKeypress方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: onKeyDown
import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
public boolean onKeyDown(TextView widget, Spannable buffer, int keyCode, KeyEvent event) {
if (executeDown(widget, buffer, keyCode,event)) {
MetaKeyKeyListener.adjustMetaAfterKeypress(buffer);
resetLockedMeta(buffer);
return true;
}
return false;
}
示例6: 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;
}
示例7: 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;
}
示例8: 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;
}
示例9: executeDown
import android.text.method.MetaKeyKeyListener; //导入方法依赖的package包/类
private boolean executeDown(TextView widget, Spannable buffer, int keyCode , KeyEvent event) {
boolean handled = false;
if ( keyCode == KEYCODE_PAGE_UP ){
handled |= volup(widget, buffer);
}else if ( keyCode == KEYCODE_PAGE_DOWN){
handled |= voldown(widget, buffer);
}else if ( keyCode == KEYCODE_MOVE_HOME){
handled |= movehome(widget, buffer ,event);
}else if ( keyCode == KEYCODE_MOVE_END){
handled |= moveend(widget, buffer , event);
}else{
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_UP:
handled |= up(widget, buffer);
break;
case KeyEvent.KEYCODE_DPAD_DOWN:
handled |= down(widget, buffer);
break;
case KeyEvent.KEYCODE_DPAD_LEFT:
handled |= left(widget, buffer);
break;
case KeyEvent.KEYCODE_DPAD_RIGHT:
handled |= right(widget, buffer);
break;
case KeyEvent.KEYCODE_DPAD_CENTER:
if (JotaTextKeyListener.getMetaStateSelecting(buffer) != 0) {
if (widget.showContextMenu()) {
handled = true;
}
}
break;
case KeyEvent.KEYCODE_VOLUME_UP:
if ( sUseVolumeKey ){
handled |= volup(widget, buffer);
}
break;
case KeyEvent.KEYCODE_VOLUME_DOWN:
if ( sUseVolumeKey ){
handled |= voldown(widget, buffer);
}
break;
}
}
if (handled) {
MetaKeyKeyListener.adjustMetaAfterKeypress(buffer);
resetLockedMeta(buffer);
}
return handled;
}
示例10: 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;
}