本文整理汇总了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();
}
}
示例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);
}
}
示例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);
}
示例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
);
}
}
示例5: consumeTraversalKey
import java.awt.event.KeyEvent; //导入方法依赖的package包/类
private void consumeTraversalKey(KeyEvent e) {
e.consume();
consumeNextKeyTyped = (e.getID() == KeyEvent.KEY_PRESSED) &&
!e.isActionKey();
}