本文整理汇总了Java中android.view.KeyEvent.KEYCODE_FORWARD_DEL属性的典型用法代码示例。如果您正苦于以下问题:Java KeyEvent.KEYCODE_FORWARD_DEL属性的具体用法?Java KeyEvent.KEYCODE_FORWARD_DEL怎么用?Java KeyEvent.KEYCODE_FORWARD_DEL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.view.KeyEvent
的用法示例。
在下文中一共展示了KeyEvent.KEYCODE_FORWARD_DEL属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendDeleteKeys
private static boolean sendDeleteKeys(Element el)
throws UiObjectNotFoundException, IllegalAccessException,
InvocationTargetException, NoSuchMethodException {
String tempTextHolder = "";
while (!el.getText().isEmpty() && !tempTextHolder.equalsIgnoreCase(el.getText())) {
el.click();
for (int key : new int[]{KeyEvent.KEYCODE_DEL, KeyEvent.KEYCODE_FORWARD_DEL}) {
tempTextHolder = el.getText();
final int length = tempTextHolder.length();
for (int count = 0; count < length; count++) {
try {
InteractionController interactionController = UiAutomatorBridge.getInstance().getInteractionController();
interactionController.sendKey(key, 0);
} catch (Exception e) {
System.out.println("UiAutomatorBridge.getInteractionController error happen!");
}
}
}
}
return el.getText().isEmpty();
}
示例2: onKey
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_ENTER) {
if (event.getAction() != KeyEvent.ACTION_DOWN) {
return true;
}
if (mCommitListener != null) {
mCommitListener.onCommit();
}
return true;
}
if ((keyCode == KeyEvent.KEYCODE_DEL ||
(keyCode == KeyEvent.KEYCODE_FORWARD_DEL)) &&
removeAutocomplete(getText())) {
// Delete autocomplete text when backspacing or forward deleting.
return true;
}
return false;
}
示例3: onKeyDown
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_R:
mViewModel.addRectLayer();
return true;
case KeyEvent.KEYCODE_T:
mViewModel.addTriangleLayer();
return true;
case KeyEvent.KEYCODE_O:
mViewModel.addOvalLayer();
return true;
}
if (mBinding.documentView.hasFocus()) {
switch (keyCode) {
case KeyEvent.KEYCODE_DEL:
case KeyEvent.KEYCODE_FORWARD_DEL:
return onContextMenuAction(DELETE);
}
if (event.isCtrlPressed()) {
switch (keyCode) {
case KeyEvent.KEYCODE_X:
return onContextMenuAction(CUT);
case KeyEvent.KEYCODE_C:
return onContextMenuAction(COPY);
case KeyEvent.KEYCODE_V:
return onContextMenuAction(PASTE);
case KeyEvent.KEYCODE_D:
return onContextMenuAction(DUPLICATE);
case KeyEvent.KEYCODE_G:
return onContextMenuAction(GROUP);
}
}
}
return super.onKeyDown(keyCode, event);
}
示例4: shouldConsume
/**
* Returns true only if this utility class handles the key code.
*/
public static boolean shouldConsume(int keyCode) {
return (keyCode == KeyEvent.KEYCODE_DPAD_LEFT || keyCode == KeyEvent.KEYCODE_DPAD_RIGHT ||
keyCode == KeyEvent.KEYCODE_DPAD_UP || keyCode == KeyEvent.KEYCODE_DPAD_DOWN ||
keyCode == KeyEvent.KEYCODE_MOVE_HOME || keyCode == KeyEvent.KEYCODE_MOVE_END ||
keyCode == KeyEvent.KEYCODE_PAGE_UP || keyCode == KeyEvent.KEYCODE_PAGE_DOWN ||
keyCode == KeyEvent.KEYCODE_DEL || keyCode == KeyEvent.KEYCODE_FORWARD_DEL);
}
示例5: isUninstallKeyChord
/**
* Returns whether the key event represents a valid uninstall key chord.
*/
private static boolean isUninstallKeyChord(KeyEvent event) {
int keyCode = event.getKeyCode();
return (keyCode == KeyEvent.KEYCODE_DEL || keyCode == KeyEvent.KEYCODE_FORWARD_DEL) &&
event.hasModifiers(KeyEvent.META_CTRL_ON | KeyEvent.META_SHIFT_ON);
}
示例6: isDeleteKeyChord
/**
* Returns whether the key event represents a valid delete key chord.
*/
private static boolean isDeleteKeyChord(KeyEvent event) {
int keyCode = event.getKeyCode();
return (keyCode == KeyEvent.KEYCODE_DEL || keyCode == KeyEvent.KEYCODE_FORWARD_DEL) &&
event.hasModifiers(KeyEvent.META_CTRL_ON);
}