本文整理匯總了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();
}