当前位置: 首页>>代码示例>>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;未经允许,请勿转载。