Java Code Examples for java.awt.event.KeyEvent#VK_DEAD_ACUTE

The following examples show how to use java.awt.event.KeyEvent#VK_DEAD_ACUTE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DeadKeyMacOSXInputText.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 2
Source File: DeadKeyMacOSXInputText.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 3
Source File: DeadKeyMacOSXInputText.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 4
Source File: DeadKeyMacOSXInputText.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 5
Source File: DeadKeyMacOSXInputText.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 6
Source File: DeadKeyMacOSXInputText.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 7
Source File: DeadKeyMacOSXInputText.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 8
Source File: DeadKeyMacOSXInputText.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 9
Source File: DeadKeyMacOSXInputText.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 10
Source File: DeadKeyMacOSXInputText.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 11
Source File: deadKeyMacOSX.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@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.");
    }
}
 
Example 12
Source File: deadKeyMacOSX.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@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.");
    }
}
 
Example 13
Source File: deadKeyMacOSX.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@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.");
    }
}
 
Example 14
Source File: deadKeyMacOSX.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@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.");
    }
}
 
Example 15
Source File: deadKeyMacOSX.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@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.");
    }
}
 
Example 16
Source File: deadKeyMacOSX.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@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.");
    }
}
 
Example 17
Source File: deadKeyMacOSX.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@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.");
    }
}
 
Example 18
Source File: deadKeyMacOSX.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@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.");
    }
}
 
Example 19
Source File: deadKeyMacOSX.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@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.");
    }
}
 
Example 20
Source File: DefaultKeyboardHandler.java    From tn5250j with GNU General Public License v2.0 4 votes vote down vote up
protected void displayInfo(KeyEvent e, String s) {
  String charString, keyCodeString, modString, tmpString, isString;

  char c = e.getKeyChar();
  int keyCode = e.getKeyCode();
  int modifiers = e.getModifiers();

  if (Character.isISOControl(c)) {
    charString = "key character = "
        + "(an unprintable control character)";
  } else {
    charString = "key character = '"
        + c + "'";
  }

  keyCodeString = "key code = " + keyCode
      + " ("
      + KeyEvent.getKeyText(keyCode)
      + ")";
  if (keyCode == KeyEvent.VK_PREVIOUS_CANDIDATE) {

    keyCodeString += " previous candidate ";

  }

  if (keyCode == KeyEvent.VK_DEAD_ABOVEDOT ||
      keyCode == KeyEvent.VK_DEAD_ABOVERING ||
      keyCode == KeyEvent.VK_DEAD_ACUTE ||
      keyCode == KeyEvent.VK_DEAD_BREVE ||
      keyCode == KeyEvent.VK_DEAD_CIRCUMFLEX

      ) {

    keyCodeString += " dead key ";

  }

  modString = "modifiers = " + modifiers;
  tmpString = KeyEvent.getKeyModifiersText(modifiers);
  if (tmpString.length() > 0) {
    modString += " (" + tmpString + ")";
  } else {
    modString += " (no modifiers)";
  }

  isString = "isKeys = isActionKey (" + e.isActionKey() + ")" +
      " isAltDown (" + e.isAltDown() + ")" +
      " isAltGraphDown (" + e.isAltGraphDown() + ")" +
      " isAltGraphDownLinux (" + isAltGr + ")" +
      " isControlDown (" + e.isControlDown() + ")" +
      " isMetaDown (" + e.isMetaDown() + ")" +
      " isShiftDown (" + e.isShiftDown() + ")";


  String newline = "\n";
  System.out.println(s + newline
      + "    " + charString + newline
      + "    " + keyCodeString + newline
      + "    " + modString + newline
      + "    " + isString + newline);

}