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


Java KeyEvent.VK_DEAD_ACUTE属性代码示例

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


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

示例1: isDeadKey

/**
 * Determines whether the given key is a dead key.
 */
public static boolean isDeadKey(KeyEvent event)
{
    switch(event.getKeyCode()) {
        case KeyEvent.VK_DEAD_GRAVE:
        case KeyEvent.VK_DEAD_ACUTE:
        case KeyEvent.VK_DEAD_CIRCUMFLEX:
        case KeyEvent.VK_DEAD_TILDE:
        case KeyEvent.VK_DEAD_MACRON:
        case KeyEvent.VK_DEAD_BREVE:
        case KeyEvent.VK_DEAD_ABOVEDOT:
        case KeyEvent.VK_DEAD_DIAERESIS:
        case KeyEvent.VK_DEAD_ABOVERING:
        case KeyEvent.VK_DEAD_DOUBLEACUTE:
        case KeyEvent.VK_DEAD_CARON:
        case KeyEvent.VK_DEAD_CEDILLA:
        case KeyEvent.VK_DEAD_OGONEK:
        case KeyEvent.VK_DEAD_IOTA:
        case KeyEvent.VK_DEAD_VOICED_SOUND:
        case KeyEvent.VK_DEAD_SEMIVOICED_SOUND:
            return true;
    }
    return false;
}
 
开发者ID:fesch,项目名称:Moenagade,代码行数:26,代码来源:Console.java

示例2: keyPressed

@Override
public void keyPressed(KeyEvent e) {
    int keyCode = e.getKeyCode();
    char keyChar = e.getKeyChar();

    switch (state) {
        case 0:
            if (keyCode != KeyEvent.VK_ALT) {
                throw new RuntimeException("Alt is not pressed.");
            }
            state++;
            break;
        case 1:
            if (keyCode != KeyEvent.VK_DEAD_ACUTE) {
                throw new RuntimeException("Dead ACUTE is not pressed.");
            }
            if (keyChar != 0xB4) {
                throw new RuntimeException("Pressed char is not dead acute.");
            }
            state++;
            break;
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:23,代码来源:DeadKeyMacOSXInputText.java

示例3: keyPressed

@Override
public void keyPressed(KeyEvent e) {
    int keyCode = e.getKeyCode();
    char keyChar = e.getKeyChar();

    switch (state) {
        case 0:
            if (keyCode != KeyEvent.VK_ALT) {
                throw new RuntimeException("Alt is not pressed.");
            }
            state++;
            break;
        case 1:
            if (keyCode != KeyEvent.VK_DEAD_ACUTE) {
                throw new RuntimeException("Dead ACUTE is not pressed.");
            }
            if (keyChar != 0xB4) {
                throw new RuntimeException("Pressed char is not dead acute.");
            }

            state++;
            break;
        case 2:
            if (keyCode != KeyEvent.VK_A) {
                throw new RuntimeException("A is not pressed.");
            }
            if (keyChar != 0xE1) {
                throw new RuntimeException("A char does not have ACCUTE accent");
            }
            state++;
            break;
        default:
            throw new RuntimeException("Excessive keyPressed event.");
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:35,代码来源:deadKeyMacOSX.java


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