當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。