本文整理汇总了Java中android.view.KeyCharacterMap.KeyData类的典型用法代码示例。如果您正苦于以下问题:Java KeyData类的具体用法?Java KeyData怎么用?Java KeyData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KeyData类属于android.view.KeyCharacterMap包,在下文中一共展示了KeyData类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findItemsWithShortcutForKey
import android.view.KeyCharacterMap.KeyData; //导入依赖的package包/类
void findItemsWithShortcutForKey(List<MenuItemImpl> items, int keyCode, KeyEvent event) {
boolean qwerty = isQwertyMode();
int metaState = event.getMetaState();
KeyData possibleChars = new KeyData();
if (event.getKeyData(possibleChars) || keyCode == 67) {
int N = this.mItems.size();
for (int i = 0; i < N; i++) {
MenuItemImpl item = (MenuItemImpl) this.mItems.get(i);
if (item.hasSubMenu()) {
((MenuBuilder) item.getSubMenu()).findItemsWithShortcutForKey(items, keyCode, event);
}
char shortcutChar = qwerty ? item.getAlphabeticShortcut() : item.getNumericShortcut();
if ((metaState & 5) == 0 && shortcutChar != '\u0000' && ((shortcutChar == possibleChars.meta[0] || shortcutChar == possibleChars.meta[2] || (qwerty && shortcutChar == '\b' && keyCode == 67)) && item.isEnabled())) {
items.add(item);
}
}
}
}
示例2: findItemWithShortcutForKey
import android.view.KeyCharacterMap.KeyData; //导入依赖的package包/类
MenuItemImpl findItemWithShortcutForKey(int keyCode, KeyEvent event) {
ArrayList<MenuItemImpl> items = this.mTempShortcutItemList;
items.clear();
findItemsWithShortcutForKey(items, keyCode, event);
if (items.isEmpty()) {
return null;
}
int metaState = event.getMetaState();
KeyData possibleChars = new KeyData();
event.getKeyData(possibleChars);
int size = items.size();
if (size == 1) {
return (MenuItemImpl) items.get(0);
}
boolean qwerty = isQwertyMode();
for (int i = 0; i < size; i++) {
MenuItemImpl item = (MenuItemImpl) items.get(i);
char shortcutChar = qwerty ? item.getAlphabeticShortcut() : item.getNumericShortcut();
if ((shortcutChar == possibleChars.meta[0] && (metaState & 2) == 0) || ((shortcutChar == possibleChars.meta[2] && (metaState & 2) != 0) || (qwerty && shortcutChar == '\b' && keyCode == 67))) {
return item;
}
}
return null;
}
示例3: m2114a
import android.view.KeyCharacterMap.KeyData; //导入依赖的package包/类
void m2114a(List list, int i, KeyEvent keyEvent) {
boolean b = m2124b();
int metaState = keyEvent.getMetaState();
KeyData keyData = new KeyData();
if (keyEvent.getKeyData(keyData) || i == 67) {
int size = this.f966j.size();
for (int i2 = 0; i2 < size; i2++) {
C0272m c0272m = (C0272m) this.f966j.get(i2);
if (c0272m.hasSubMenu()) {
((C0264i) c0272m.getSubMenu()).m2114a(list, i, keyEvent);
}
char alphabeticShortcut = b ? c0272m.getAlphabeticShortcut() : c0272m.getNumericShortcut();
if ((metaState & 5) == 0 && alphabeticShortcut != '\u0000' && ((alphabeticShortcut == keyData.meta[0] || alphabeticShortcut == keyData.meta[2] || (b && alphabeticShortcut == '\b' && i == 67)) && c0272m.isEnabled())) {
list.add(c0272m);
}
}
}
}
示例4: m2105a
import android.view.KeyCharacterMap.KeyData; //导入依赖的package包/类
C0272m m2105a(int i, KeyEvent keyEvent) {
List list = this.f978v;
list.clear();
m2114a(list, i, keyEvent);
if (list.isEmpty()) {
return null;
}
int metaState = keyEvent.getMetaState();
KeyData keyData = new KeyData();
keyEvent.getKeyData(keyData);
int size = list.size();
if (size == 1) {
return (C0272m) list.get(0);
}
boolean b = m2124b();
for (int i2 = 0; i2 < size; i2++) {
C0272m c0272m = (C0272m) list.get(i2);
char alphabeticShortcut = b ? c0272m.getAlphabeticShortcut() : c0272m.getNumericShortcut();
if (alphabeticShortcut == keyData.meta[0] && (metaState & 2) == 0) {
return c0272m;
}
if (alphabeticShortcut == keyData.meta[2] && (metaState & 2) != 0) {
return c0272m;
}
if (b && alphabeticShortcut == '\b' && i == 67) {
return c0272m;
}
}
return null;
}
示例5: findItemWithShortcutForKey
import android.view.KeyCharacterMap.KeyData; //导入依赖的package包/类
private MenuItemImpl findItemWithShortcutForKey(int paramInt, KeyEvent paramKeyEvent)
{
ArrayList localArrayList = this.mTempShortcutItemList;
localArrayList.clear();
findItemsWithShortcutForKey(localArrayList, paramInt, paramKeyEvent);
if (localArrayList.isEmpty()) {}
for (;;)
{
return null;
int i = paramKeyEvent.getMetaState();
KeyCharacterMap.KeyData localKeyData = new KeyCharacterMap.KeyData();
paramKeyEvent.getKeyData(localKeyData);
int j = localArrayList.size();
if (j == 1) {
return (MenuItemImpl)localArrayList.get(0);
}
boolean bool = isQwertyMode();
for (int k = 0; k < j; k++)
{
MenuItemImpl localMenuItemImpl = (MenuItemImpl)localArrayList.get(k);
if (bool) {}
for (int m = localMenuItemImpl.getAlphabeticShortcut(); ((m == localKeyData.meta[0]) && ((i & 0x2) == 0)) || ((m == localKeyData.meta[2]) && ((i & 0x2) != 0)) || ((bool) && (m == 8) && (paramInt == 67)); m = localMenuItemImpl.getNumericShortcut()) {
return localMenuItemImpl;
}
}
}
}
示例6: a
import android.view.KeyCharacterMap.KeyData; //导入依赖的package包/类
private xp a(int paramInt, KeyEvent paramKeyEvent)
{
ArrayList localArrayList = this.x;
localArrayList.clear();
a(localArrayList, paramInt, paramKeyEvent);
xp localxp;
if (localArrayList.isEmpty()) {
localxp = null;
}
label181:
for (;;)
{
return localxp;
int i1 = paramKeyEvent.getMetaState();
KeyCharacterMap.KeyData localKeyData = new KeyCharacterMap.KeyData();
paramKeyEvent.getKeyData(localKeyData);
int i2 = localArrayList.size();
if (i2 == 1) {
return (xp)localArrayList.get(0);
}
boolean bool = b();
int i3 = 0;
if (i3 >= i2) {
break;
}
localxp = (xp)localArrayList.get(i3);
if (bool) {}
for (int i4 = localxp.getAlphabeticShortcut();; i4 = localxp.getNumericShortcut())
{
if (((i4 == localKeyData.meta[0]) && ((i1 & 0x2) == 0)) || ((i4 == localKeyData.meta[2]) && ((i1 & 0x2) != 0)) || ((bool) && (i4 == 8) && (paramInt == 67))) {
break label181;
}
i3++;
break;
}
}
return null;
}