当前位置: 首页>>代码示例>>Java>>正文


Java KeyEvent.KEYCODE_FORWARD_DEL属性代码示例

本文整理汇总了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();
}
 
开发者ID:macacajs,项目名称:UIAutomatorWD,代码行数:23,代码来源:ElementController.java

示例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;
}
 
开发者ID:mozilla-mobile,项目名称:firefox-tv,代码行数:23,代码来源:InlineAutocompleteEditText.java

示例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);
}
 
开发者ID:google,项目名称:spline,代码行数:40,代码来源:EditorActivity.java

示例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);
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:10,代码来源:FocusLogic.java

示例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);
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:8,代码来源:FocusHelper.java

示例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);
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:8,代码来源:FocusHelper.java


注:本文中的android.view.KeyEvent.KEYCODE_FORWARD_DEL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。