当前位置: 首页>>代码示例>>Java>>正文


Java KeyEvent.isMetaDown方法代码示例

本文整理汇总了Java中java.awt.event.KeyEvent.isMetaDown方法的典型用法代码示例。如果您正苦于以下问题:Java KeyEvent.isMetaDown方法的具体用法?Java KeyEvent.isMetaDown怎么用?Java KeyEvent.isMetaDown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.event.KeyEvent的用法示例。


在下文中一共展示了KeyEvent.isMetaDown方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: keyReleased

import java.awt.event.KeyEvent; //导入方法依赖的package包/类
@Override
public void keyReleased(KeyEvent event) {
    if (event.isControlDown() || event.isMetaDown()) {
        switch (event.getKeyCode()) {
            case KeyEvent.VK_C:
                // Copy
                cancelEditing();
                XTableUtils.copyToClipboard(table, false);
                break;
            case KeyEvent.VK_X:
                // Cut
                cancelEditing();
                XTableUtils.copyToClipboard(table, true);
                break;
            case KeyEvent.VK_V:
                // Paste
                cancelEditing();
                XTableUtils.pasteFromClipboard(table);
                break;
            default:
                break;
        }
    }

}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:26,代码来源:ClipboardKeyAdapter.java

示例2: keyPressed

import java.awt.event.KeyEvent; //导入方法依赖的package包/类
@Override
public void keyPressed(KeyEvent e) {
    if (e.isAltDown() || e.isAltGraphDown() ||
        e.isControlDown() || e.isMetaDown() ||
        e.isShiftDown()) {

        setSelectCursor();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:WatchAnnotationProvider.java

示例3: keyReleased

import java.awt.event.KeyEvent; //导入方法依赖的package包/类
@Override
public void keyReleased(KeyEvent e) {
    if (!(e.isAltDown() || e.isAltGraphDown() ||
          e.isControlDown() || e.isMetaDown() ||
          e.isShiftDown())) {

        unsetSelectCursor();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:WatchAnnotationProvider.java

示例4: 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

示例5: keyPressed

import java.awt.event.KeyEvent; //导入方法依赖的package包/类
@Override
public void keyPressed(KeyEvent e) {
	// Windows: CTRL-S (e.isControlDown())
	// MacOS: CTRL-S (e.isMetaDown())
    if ((e.isControlDown() || e.isMetaDown()) && e.getKeyCode() == KeyEvent.VK_S) {
    	File f = selectFile();
    	if (f != null) {
    		saveTo(f);
    	}
    }
}
 
开发者ID:imagingbook,项目名称:JGraphix,代码行数:12,代码来源:DrawFrame.java

示例6: keyPressed

import java.awt.event.KeyEvent; //导入方法依赖的package包/类
@Override
   public void keyPressed(final KeyEvent e) {
if (!e.isMetaDown()) {
    this.screen = this.screen.respondToUserInput(e, null);
    this.repaint();
}
   }
 
开发者ID:wrldwzrd89,项目名称:dynamic-dungeon,代码行数:8,代码来源:DynamicDungeon.java

示例7: isSave

import java.awt.event.KeyEvent; //导入方法依赖的package包/类
private static boolean isSave(KeyEvent ke) {
    return (ke.isMetaDown() || ke.isControlDown()) && ke.getKeyCode() == KeyEvent.VK_S;
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:4,代码来源:StyledEditor.java

示例8: isControlOrMetaDown

import java.awt.event.KeyEvent; //导入方法依赖的package包/类
/**
 * Returns whether or not the control modifier is down during the event. This takes the OS into
 * account, so on Mac it will check if the meta modifier is down during the event.
 *
 * @param e
 *            the event
 * @return {@code true} if the control modifier is down on Windows/Linux or the meta modifier is
 *         down on Mac; {@code false} otherwise
 */
public static boolean isControlOrMetaDown(KeyEvent e) {
	if (!IS_MAC) {
		return e.isControlDown();
	} else {
		return e.isMetaDown();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:17,代码来源:SwingTools.java


注:本文中的java.awt.event.KeyEvent.isMetaDown方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。