本文整理汇总了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;
}
示例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;
}
}
示例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.");
}
}