當前位置: 首頁>>代碼示例>>Java>>正文


Java KeyEvent.isActionKey方法代碼示例

本文整理匯總了Java中java.awt.event.KeyEvent.isActionKey方法的典型用法代碼示例。如果您正苦於以下問題:Java KeyEvent.isActionKey方法的具體用法?Java KeyEvent.isActionKey怎麽用?Java KeyEvent.isActionKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.event.KeyEvent的用法示例。


在下文中一共展示了KeyEvent.isActionKey方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: keyReleased

import java.awt.event.KeyEvent; //導入方法依賴的package包/類
@Override
public void keyReleased(KeyEvent e) {
	if ((e.getKeyCode() == KeyEvent.VK_ESCAPE) || (e.getKeyCode() == KeyEvent.VK_BACK_SPACE)) {
		e.consume();
	} else if (!e.isActionKey()) {
		this.mainText = this.getText();
		generatePopup(true);
		this.requestFocus();
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:11,代碼來源:AutomaticTextField.java

示例2: updateFilter

import java.awt.event.KeyEvent; //導入方法依賴的package包/類
private void updateFilter(KeyEvent e) {
	String filterText = getText();
	if ((filterText == null) || (filterText.length() == 0)) {
		if ((e == null)
				|| ((e.getKeyCode() != KeyEvent.VK_BACK_SPACE) && (e.getKeyCode() != KeyEvent.VK_DELETE)
						&& (e.getKeyCode() != KeyEvent.VK_SHIFT) && (e.getKeyCode() != KeyEvent.VK_ALT)
						&& (e.getKeyCode() != KeyEvent.VK_ALT_GRAPH) && (e.getKeyCode() != KeyEvent.VK_CONTROL)
						&& (e.getKeyCode() != KeyEvent.VK_META) && (!e.isActionKey()))) {
			setText(null);
		}
	}
	for (FilterListener l : filterListeners) {
		l.valueChanged(filterText);
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:16,代碼來源:FilterTextField.java

示例3: recordRawKeyEvent

import java.awt.event.KeyEvent; //導入方法依賴的package包/類
@Override public void recordRawKeyEvent(RComponent r, KeyEvent e) {
    JSONObject event = new JSONObject();
    event.put("type", "key_raw");
    int keyCode = e.getKeyCode();
    if (keyCode == KeyEvent.VK_META || keyCode == KeyEvent.VK_SHIFT || keyCode == KeyEvent.VK_ALT
            || keyCode == KeyEvent.VK_CONTROL) {
        return;
    }
    if ((e.isActionKey() || e.isControlDown() || e.isMetaDown() || e.isAltDown()) && e.getID() == KeyEvent.KEY_PRESSED) {
        String mtext = buildModifiersText(e);
        event.put("modifiersEx", mtext);
        KeysMap keysMap = KeysMap.findMap(e.getKeyCode());
        if (keysMap == KeysMap.NULL) {
            return;
        }
        String keyText;
        if (keysMap == null) {
            keyText = KeyEvent.getKeyText(e.getKeyCode());
        } else {
            keyText = keysMap.toString();
        }
        event.put("keyCode", keyText);
    } else if (e.getID() == KeyEvent.KEY_TYPED && !e.isControlDown()) {
        if (Character.isISOControl(e.getKeyChar()) && hasMapping(e.getKeyChar())) {
            event.put("keyChar", getMapping(e.getKeyChar()));
        } else {
            event.put("keyChar", "" + e.getKeyChar());
        }
    } else {
        return;
    }
    recordEvent(r, event);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:34,代碼來源:WSRecorder.java

示例4: processKeyEvent

import java.awt.event.KeyEvent; //導入方法依賴的package包/類
/** Overridden to allow standard keybinding processing of VK_TAB and
 * abort any pending drag operation on the vertical grid. */
public void processKeyEvent(KeyEvent e) {
    if (dragListener.isArmed()) {
        dragListener.setArmed(false);
    }

    boolean suppressDefaultHandling = ((searchField != null) && searchField.isShowing()) &&
        ((e.getKeyCode() == KeyEvent.VK_UP) || (e.getKeyCode() == KeyEvent.VK_DOWN));

    //Manually hook in the bindings for tab - does not seem to get called
    //automatically
    if (e.getKeyCode() != e.VK_TAB) {
        if (!suppressDefaultHandling) {
            //Either the search field or the table should handle up/down, not both
            super.processKeyEvent(e);
        }

        if (!e.isConsumed()) {
            if ((e.getID() == KeyEvent.KEY_PRESSED) && !isEditing()) {
                int modifiers = e.getModifiers();
                int keyCode = e.getKeyCode();

                if (((modifiers > 0) && (modifiers != KeyEvent.SHIFT_MASK)) || e.isActionKey()) {
                    return;
                }

                char c = e.getKeyChar();

                if (!Character.isISOControl(c) && (keyCode != KeyEvent.VK_SHIFT) &&
                        (keyCode != KeyEvent.VK_ESCAPE)) {
                    searchArmed = true;
                    e.consume();
                }
            } else if (searchArmed && (e.getID() == KeyEvent.KEY_TYPED)) {
                passToSearchField(e);
                e.consume();
                searchArmed = false;
            } else {
                searchArmed = false;
            }
        }
    } else {
        processKeyBinding(
            KeyStroke.getKeyStroke(e.VK_TAB, e.getModifiersEx(), e.getID() == e.KEY_RELEASED), e,
            JComponent.WHEN_FOCUSED, e.getID() == e.KEY_PRESSED
        );
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:50,代碼來源:BaseTable.java

示例5: consumeTraversalKey

import java.awt.event.KeyEvent; //導入方法依賴的package包/類
private void consumeTraversalKey(KeyEvent e) {
    e.consume();
    consumeNextKeyTyped = (e.getID() == KeyEvent.KEY_PRESSED) &&
                          !e.isActionKey();
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:6,代碼來源:DefaultKeyboardFocusManager.java


注:本文中的java.awt.event.KeyEvent.isActionKey方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。