本文整理了Java中android.view.KeyEvent.getUnicodeChar()
方法的一些代码示例,展示了KeyEvent.getUnicodeChar()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyEvent.getUnicodeChar()
方法的具体详情如下:
包路径:android.view.KeyEvent
类名称:KeyEvent
方法名:getUnicodeChar
暂无
代码示例来源:origin: stackoverflow.com
else if(event.getUnicodeChar() ==
(int)EditableAccomodatingLatinIMETypeNullIssues.ONE_UNPROCESSED_CHARACTER.charAt(0))
代码示例来源:origin: robolectric/robolectric
String.format(
"Failed to get event for character (%c) with key code (%s)",
event.getKeyCode(), event.getUnicodeChar()));
String.format(
"Failed to inject event for character (%c) with key code (%s)",
event.getUnicodeChar(), event.getKeyCode()));
break;
代码示例来源:origin: libgdx/libgdx
char character = (char)e.getUnicodeChar();
代码示例来源:origin: libgdx/libgdx
char character = (char)e.getUnicodeChar();
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
char unicodeChar = (char)event.getUnicodeChar();
int jmeKeyCode = AndroidKeyMapping.getJmeKey(event.getKeyCode());
代码示例来源:origin: termux/termux-app
} else if (e.isCtrlPressed() && e.isAltPressed()) {
int unicodeChar = e.getUnicodeChar(0);
} else if (unicodeChar == 'v') {
mActivity.doPaste();
} else if (unicodeChar == '+' || e.getUnicodeChar(KeyEvent.META_SHIFT_ON) == '+') {
代码示例来源:origin: termux/termux-app
int result = event.getUnicodeChar(effectiveMetaState);
if (LOG_KEY_EVENTS)
Log.i(EmulatorDebug.LOG_TAG, "KeyEvent#getUnicodeChar(" + effectiveMetaState + ") returned: " + result);
代码示例来源:origin: ankidroid/Anki-Android
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
char keyPressed = (char) event.getUnicodeChar();
if (mAnswerField != null && !mAnswerField.isFocused()) {
if (sDisplayAnswer) {
代码示例来源:origin: org.robolectric/robolectric
String.format(
"Failed to get event for character (%c) with key code (%s)",
event.getKeyCode(), event.getUnicodeChar()));
String.format(
"Failed to inject event for character (%c) with key code (%s)",
event.getUnicodeChar(), event.getKeyCode()));
break;
代码示例来源:origin: stackoverflow.com
@Override
public boolean onKeyUp (int keyCode, KeyEvent event){
char c = (char) event.getUnicodeChar();
//Do something....
return super.onKeyUp(keyCode, event);
}
代码示例来源:origin: stackoverflow.com
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
Log.d("TEST", "Key Down :" + keyCode + " String : " + s);
s += (char) event.getUnicodeChar();
return super.onKeyDown(keyCode, event);
}
代码示例来源:origin: stackoverflow.com
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
char c = (char) event.getUnicodeChar();
if (c == KeyEvent.KEYCODE_SEARCH) {
return false;
} else {
return super.onKeyDown(keyCode, event);
}
}
代码示例来源:origin: stackoverflow.com
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
char pressedKey = (char) event.getUnicodeChar();
Barcode += "" + pressedKey;
Toast.makeText(getApplicationContext(), "barcode--->>>" + Barcode, 1)
.show();
return true;
}
代码示例来源:origin: stackoverflow.com
mContext.getGameView().setOnKeyListener(new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
char pressedKey = (char) event.getUnicodeChar();
if(event.getAction() == KeyEvent.ACTION_DOWN){
if(event.getUnicodeChar() == 0){
setName.setTitle(removeLastChar(setName.getTitle()));
} else
setName.setTitle(setName.getTitle() + (char) event.getUnicodeChar());}
return false;
}
});
代码示例来源:origin: stackoverflow.com
public boolean onKeyDown(int keyCode, KeyEvent event) {
Log.v("log_tag", "char : " + event.getUnicodeChar());
if (event.getUnicodeChar() != 0) {
int i = event.getUnicodeChar();
ch += new Character((char) i).toString();
}
if (keyCode == KeyEvent.KEYCODE_DEL && ch.length() > 0) {
ch = ch.substring(0, ch.length() - 1);
}
value.setText(ch);
return super.onKeyDown(keyCode, event);
}
代码示例来源:origin: stackoverflow.com
@Override
public boolean onKey(View v, int keyCode, KeyEvent event)
{
if (event.getAction() != KeyEvent.ACTION_DOWN)
return false;
if ((int)DUMMY_CHAR.charAt(0) == event.getUnicodeChar())
return true;
// Handle event/keyCode here as normal...
}
代码示例来源:origin: stackoverflow.com
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
char pressedKey = (char) event.getUnicodeChar();
Log.d("onKeyUp is: ", Character.toString(pressedKey));
return super.onKeyUp(keyCode, event);
}
代码示例来源:origin: lexica/lexica
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode >= KeyEvent.KEYCODE_A && keyCode <= KeyEvent.KEYCODE_Z) {
String letter = Character.toString((char) event.getUnicodeChar()).toLowerCase();
mKeyboardTracker.processLetter(game.getLanguage().applyMandatorySuffix(letter));
} else if (keyCode == KeyEvent.KEYCODE_SPACE ||
keyCode == KeyEvent.KEYCODE_ENTER) {
mKeyboardTracker.reset();
}
return false;
}
代码示例来源:origin: dektar/jterm-cswithandroid
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
int unicode = event.getUnicodeChar();
if (('A' <= unicode && unicode <= 'Z') || 'a' <= unicode && unicode <= 'z') {
String character = ((char) unicode + "").toLowerCase();
currentWord += character;
((TextView) findViewById(R.id.ghostText)).setText(currentWord);
computerTurn();
}
return super.onKeyUp(keyCode, event);
}
代码示例来源:origin: playn/playn
void onKeyDown (int keyCode, KeyEvent nativeEvent) {
long time = nativeEvent.getEventTime();
Keyboard.KeyEvent event = new Keyboard.KeyEvent(0, time, keyForCode(keyCode), true);
event.setFlag(mods(nativeEvent));
dispatch(event);
int unicodeChar = nativeEvent.getUnicodeChar();
if (unicodeChar != 0) dispatch(new Keyboard.TypedEvent(0, time, (char)unicodeChar));
}
内容来源于网络,如有侵权,请联系作者删除!