本文整理了Java中java.awt.event.KeyEvent.isControlDown()
方法的一些代码示例,展示了KeyEvent.isControlDown()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyEvent.isControlDown()
方法的具体详情如下:
包路径:java.awt.event.KeyEvent
类名称:KeyEvent
方法名:isControlDown
暂无
代码示例来源:origin: runelite/runelite
boolean isModifierDown = OSType.getOSType() == OSType.MacOS ? e.isMetaDown() : e.isControlDown();
代码示例来源:origin: runelite/runelite
@Override
public void keyPressed(KeyEvent e)
if (!e.isControlDown() || !chatCommandsConfig.clearShortcuts())
代码示例来源:origin: runelite/runelite
if (ev.isControlDown())
代码示例来源:origin: stackoverflow.com
|| event.isControlDown() || event.getCode() == KeyCode.HOME
|| event.getCode() == KeyCode.END || event.getCode() == KeyCode.TAB) {
return;
代码示例来源:origin: winder/Universal-G-Code-Sender
break;
case KeyEvent.VK_MINUS:
if (ke.isControlDown())
this.zoomOut(1);
break;
case KeyEvent.VK_0:
if (ke.isControlDown()) {
this.zoomMultiplier = 1;
this.scaleFactor = this.scaleFactorBase;
break;
case '+':
if (ke.isControlDown())
this.zoomIn(1);
break;
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
/**
* @see KeyEvent
*/
public boolean isControlDown() {
return event.isControlDown();
}
代码示例来源:origin: org.jbpm/jbpm-examples
public void keyPressed(KeyEvent e) {
if (e.isControlDown()) {
ctrl = true;
}
}
});
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
/**
* @see KeyEvent
*/
public boolean isControlDown() {
return event.isControlDown();
}
代码示例来源:origin: stackoverflow.com
@Override
public void keyPressed(KeyEvent evt) {
if(evt.isControlDown() && evt.getKeyCode() == KeyEvent.VK_V) {
evt.consume();
}
}
代码示例来源:origin: com.darwinsys/darwinsys-api
public void keyTyped(KeyEvent ev) {
if (ev.isControlDown() && ev.getKeyChar() == 19) {
try {
doSave();
} catch (IOException e) {
JOptionPane.showMessageDialog(theFrame,
e.toString(), "Error!", JOptionPane.ERROR_MESSAGE);
}
}
}
代码示例来源:origin: JetBrains/jediterm
public static boolean isReallyTypedEvent(KeyEvent e) {
char c = e.getKeyChar();
if (c < 0x20 || c == 0x7F) return false;
if (SystemInfo.isMac) {
return !e.isMetaDown() && !e.isControlDown();
}
return !e.isAltDown() && !e.isControlDown();
}
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-languages
public void keyReleased(KeyEvent e) {
if (!e.isControlDown()) {
if (highlight != null) {
highlight.remove();
highlight = null;
}
runnable = null;
}
}
代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client
@Override
public void keyPressed(KeyEvent ke) {
if (ke.getKeyCode() == KeyEvent.VK_PASTE || (ke.isControlDown() && ke.getKeyCode() == KeyEvent.VK_V)
|| (ke.isShiftDown() && ke.getKeyCode() == KeyEvent.VK_INSERT)) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
refreshTextArea();
}
});
}
}
代码示例来源:origin: edu.toronto.cs.savant/savant-core
@Override
public void keyTyped(KeyEvent e) {
//check for: Mac + Command + 'm' OR !Mac + Ctrl + 'm'
if((MiscUtils.MAC && e.getModifiersEx() == 256 && e.getKeyChar() == 'm') ||
(!MiscUtils.MAC && e.getKeyChar() == '\n' && e.isControlDown())) {
cycleDisplayMode();
}
}
});
代码示例来源:origin: BaseXdb/basex
/**
* Returns true if the pressed key is a modifier key (including 'escape' and 'tab' + control key).
* @param e key event
* @return result of check
*/
public static boolean modifier(final KeyEvent e) {
final int c = e.getKeyCode();
return c == VK_ALT || c == VK_SHIFT || c == VK_META || c == VK_CONTROL ||
c == VK_PAUSE || c == VK_CAPS_LOCK || c == VK_ESCAPE ||
c == VK_TAB && (e.isAltDown() || e.isMetaDown() || e.isControlDown());
}
代码示例来源:origin: BaseXdb/basex
/**
* Returns true if the pressed key includes a control key.
* @param e key event
* @return result of check
*/
public static boolean control(final KeyEvent e) {
// With Mac, special characters are available via ALT
return e.isControlDown() || e.isMetaDown() || !MAC && e.isAltDown();
}
代码示例来源:origin: nifty-gui/nifty-gui
private void handleKeyEvent(@Nonnull KeyEvent e, boolean isKeyDown) {
int newKeyCode = keyCodeConverter.convertToNiftyKeyCode(e.getKeyCode(), e.getKeyLocation());
keyboardEvents.add(new KeyboardInputEvent(newKeyCode, e
.getKeyChar(), isKeyDown, e.isShiftDown(), e.isControlDown()));
}
代码示例来源:origin: com.github.nifty-gui/nifty-java2d-renderer
private void handleKeyEvent(@Nonnull KeyEvent e, boolean isKeyDown) {
int newKeyCode = keyCodeConverter.convertToNiftyKeyCode(e.getKeyCode(), e.getKeyLocation());
keyboardEvents.add(new KeyboardInputEvent(newKeyCode, e
.getKeyChar(), isKeyDown, e.isShiftDown(), e.isControlDown()));
}
代码示例来源:origin: net.imagej/imagej-legacy
@Override
public boolean interceptKeyPressed(final KeyEvent e) {
String accelerator = KeyStroke.getKeyStrokeForEvent(e).toString();
if (accelerator.startsWith("pressed ")) {
accelerator = accelerator.substring("pressed ".length());
}
return legacyService.handleShortcut(accelerator) ||
(!e.isControlDown() && legacyService.handleShortcut("control " +
accelerator));
}
代码示例来源:origin: JetBrains/jediterm
@Override
public void processKeyEvent(final KeyEvent e) {
handleKeyEvent(e);
handleHyperlinks(e.getComponent(), e.isControlDown());
e.consume();
}
内容来源于网络,如有侵权,请联系作者删除!