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

The following examples show how to use java.awt.event.KeyEvent#VK_SLASH . 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: MissingCharsKorean.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private static boolean setKeyInput(int iCount) {
    boolean inputSet = true;

    switch(iCount) {
        case 0:
            // Input Korean q (#12610) /(#47)
            expectedResults = new int[]{ 12610, 47 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH}
                                    };
            break;

        case 1:
            // Input Korean q (#12610) /(#47) gh (#54840) \(#92)
            expectedResults = new int[]{ 12610, 47, 54840, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        case 2:
            // Input Korean q (#12610) /(#47) ghq (#54857) \(#92)
            expectedResults = new int[]{ 12610, 47, 54857, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_Q},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        case 3:
            // Input Korean q (#12610) /(#47) gh (#54840) \(#92)
            expectedResults = new int[]{ 12610, 47, 54840, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_Q},
                                        {KeyEvent.VK_BACK_SPACE},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        case 4:
            // Input Korean q (#12610) /(#47) g (#12622) \(#92)
            expectedResults = new int[]{ 12610, 47, 12622, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_Q},
                                        {KeyEvent.VK_BACK_SPACE},
                                        {KeyEvent.VK_BACK_SPACE},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        default:
            inputSet = false;
            break;
    }

    return inputSet;
}
 
Example 2
Source File: MissingCharsKorean.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private static boolean setKeyInput(int iCount) {
    boolean inputSet = true;

    switch(iCount) {
        case 0:
            // Input Korean q (#12610) /(#47)
            expectedResults = new int[]{ 12610, 47 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH}
                                    };
            break;

        case 1:
            // Input Korean q (#12610) /(#47) gh (#54840) \(#92)
            expectedResults = new int[]{ 12610, 47, 54840, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        case 2:
            // Input Korean q (#12610) /(#47) ghq (#54857) \(#92)
            expectedResults = new int[]{ 12610, 47, 54857, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_Q},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        case 3:
            // Input Korean q (#12610) /(#47) gh (#54840) \(#92)
            expectedResults = new int[]{ 12610, 47, 54840, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_Q},
                                        {KeyEvent.VK_BACK_SPACE},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        case 4:
            // Input Korean q (#12610) /(#47) g (#12622) \(#92)
            expectedResults = new int[]{ 12610, 47, 12622, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_Q},
                                        {KeyEvent.VK_BACK_SPACE},
                                        {KeyEvent.VK_BACK_SPACE},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        default:
            inputSet = false;
            break;
    }

    return inputSet;
}
 
Example 3
Source File: MissingCharsKorean.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private static boolean setKeyInput(int iCount) {
    boolean inputSet = true;

    switch(iCount) {
        case 0:
            // Input Korean q (#12610) /(#47)
            expectedResults = new int[]{ 12610, 47 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH}
                                    };
            break;

        case 1:
            // Input Korean q (#12610) /(#47) gh (#54840) \(#92)
            expectedResults = new int[]{ 12610, 47, 54840, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        case 2:
            // Input Korean q (#12610) /(#47) ghq (#54857) \(#92)
            expectedResults = new int[]{ 12610, 47, 54857, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_Q},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        case 3:
            // Input Korean q (#12610) /(#47) gh (#54840) \(#92)
            expectedResults = new int[]{ 12610, 47, 54840, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_Q},
                                        {KeyEvent.VK_BACK_SPACE},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        case 4:
            // Input Korean q (#12610) /(#47) g (#12622) \(#92)
            expectedResults = new int[]{ 12610, 47, 12622, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_Q},
                                        {KeyEvent.VK_BACK_SPACE},
                                        {KeyEvent.VK_BACK_SPACE},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        default:
            inputSet = false;
            break;
    }

    return inputSet;
}
 
Example 4
Source File: MissingCharsKorean.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private static boolean setKeyInput(int iCount) {
    boolean inputSet = true;

    switch(iCount) {
        case 0:
            // Input Korean q (#12610) /(#47)
            expectedResults = new int[]{ 12610, 47 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH}
                                    };
            break;

        case 1:
            // Input Korean q (#12610) /(#47) gh (#54840) \(#92)
            expectedResults = new int[]{ 12610, 47, 54840, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        case 2:
            // Input Korean q (#12610) /(#47) ghq (#54857) \(#92)
            expectedResults = new int[]{ 12610, 47, 54857, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_Q},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        case 3:
            // Input Korean q (#12610) /(#47) gh (#54840) \(#92)
            expectedResults = new int[]{ 12610, 47, 54840, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_Q},
                                        {KeyEvent.VK_BACK_SPACE},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        case 4:
            // Input Korean q (#12610) /(#47) g (#12622) \(#92)
            expectedResults = new int[]{ 12610, 47, 12622, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_Q},
                                        {KeyEvent.VK_BACK_SPACE},
                                        {KeyEvent.VK_BACK_SPACE},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        default:
            inputSet = false;
            break;
    }

    return inputSet;
}
 
Example 5
Source File: SkillLevelIncrementCommand.java    From gcs with Mozilla Public License 2.0 4 votes vote down vote up
private SkillLevelIncrementCommand() {
    super(I18n.Text("Increase Skill Level"), CMD_INCREASE_LEVEL, KeyEvent.VK_SLASH);
}
 
Example 6
Source File: ActionUtils.java    From workcraft with MIT License 4 votes vote down vote up
public static String getKeyString(int keyCode) {
    // Letters and numbers
    if (((keyCode >= KeyEvent.VK_0) && (keyCode <= KeyEvent.VK_9))
            || ((keyCode >= KeyEvent.VK_A) && (keyCode <= KeyEvent.VK_Z))) {
        return String.valueOf((char) keyCode);
    }
    switch (keyCode) {
    // Navigation keys
    case KeyEvent.VK_LEFT: return "Left";
    case KeyEvent.VK_UP: return "Up";
    case KeyEvent.VK_RIGHT: return "Right";
    case KeyEvent.VK_DOWN: return "Down";
    // Extra navigation keys
    case KeyEvent.VK_INSERT: return "Insert";
    case KeyEvent.VK_DELETE: return "Delete";
    case KeyEvent.VK_END: return "End";
    case KeyEvent.VK_HOME: return "Home";
    case KeyEvent.VK_PAGE_UP: return "PgUp";
    case KeyEvent.VK_PAGE_DOWN: return "PgDn";
    // Function keys
    case KeyEvent.VK_F1: return "F1";
    case KeyEvent.VK_F2: return "F2";
    case KeyEvent.VK_F3: return "F3";
    case KeyEvent.VK_F4: return "F4";
    case KeyEvent.VK_F5: return "F5";
    case KeyEvent.VK_F6: return "F6";
    case KeyEvent.VK_F7: return "F7";
    case KeyEvent.VK_F8: return "F8";
    case KeyEvent.VK_F9: return "F9";
    case KeyEvent.VK_F10: return "F10";
    case KeyEvent.VK_F11: return "F11";
    case KeyEvent.VK_F12: return "F12";
    // Symbols
    case KeyEvent.VK_EXCLAMATION_MARK: return "!";
    case KeyEvent.VK_QUOTEDBL: return "\"";
    case KeyEvent.VK_EURO_SIGN: return "€";
    case KeyEvent.VK_DOLLAR: return "$";
    case KeyEvent.VK_CIRCUMFLEX: return "^";
    case KeyEvent.VK_AMPERSAND: return "&";
    case KeyEvent.VK_ASTERISK: return "*";
    case KeyEvent.VK_UNDERSCORE: return "_";
    case KeyEvent.VK_MINUS: return "-";
    case KeyEvent.VK_PLUS: return "+";
    case KeyEvent.VK_EQUALS: return "=";
    case KeyEvent.VK_AT: return "@";
    case KeyEvent.VK_NUMBER_SIGN: return "#";
    case KeyEvent.VK_COLON: return ":";
    case KeyEvent.VK_SEMICOLON: return ";";
    case KeyEvent.VK_COMMA: return ",";
    case KeyEvent.VK_PERIOD: return ".";
    case KeyEvent.VK_SLASH: return "/";
    case KeyEvent.VK_BACK_SLASH: return "\\";
    case KeyEvent.VK_DEAD_TILDE: return "~";
    // Parenthesis and brackets
    case KeyEvent.VK_LEFT_PARENTHESIS: return "(";
    case KeyEvent.VK_RIGHT_PARENTHESIS: return ")";
    case KeyEvent.VK_OPEN_BRACKET: return "[";
    case KeyEvent.VK_CLOSE_BRACKET: return "]";
    case KeyEvent.VK_BRACELEFT: return "{";
    case KeyEvent.VK_BRACERIGHT: return "}";
    case KeyEvent.VK_LESS: return "<";
    case KeyEvent.VK_GREATER: return ">";
    // Formatting keys
    case KeyEvent.VK_SPACE: return "Space";
    case KeyEvent.VK_TAB: return "Tab";
    case KeyEvent.VK_ENTER: return "Enter";
    case KeyEvent.VK_BACK_SPACE: return "Backspace";
    case KeyEvent.VK_ESCAPE: return "Esc";
    }
    return "0x" + Integer.toString(keyCode, 16);
}
 
Example 7
Source File: KeyCodeToChar.java    From Repeat with Apache License 2.0 4 votes vote down vote up
private static String getNonAlphaCharWithoutShift(int code) {
	switch (code) {
	case KeyEvent.VK_BACK_QUOTE:
		return "`";
	case KeyEvent.VK_1:
		return "1";
	case KeyEvent.VK_2:
		return "2";
	case KeyEvent.VK_3:
		return "3";
	case KeyEvent.VK_4:
		return "4";
	case KeyEvent.VK_5:
		return "5";
	case KeyEvent.VK_6:
		return "6";
	case KeyEvent.VK_7:
		return "7";
	case KeyEvent.VK_8:
		return "8";
	case KeyEvent.VK_9:
		return "9";
	case KeyEvent.VK_0:
		return "0";
	case KeyEvent.VK_MINUS:
		return "-";
	case KeyEvent.VK_EQUALS:
		return "=";
	case KeyEvent.VK_OPEN_BRACKET:
		return "[";
	case KeyEvent.VK_CLOSE_BRACKET:
		return "]";
	case KeyEvent.VK_SEMICOLON:
		return ";";
	case KeyEvent.VK_QUOTE:
		return "'";
	case KeyEvent.VK_BACK_SLASH:
		return "\\";
	case KeyEvent.VK_COMMA:
		return ",";
	case KeyEvent.VK_PERIOD:
		return ".";
	case KeyEvent.VK_SLASH:
		return "/";
	case KeyEvent.VK_TAB:
		return "\t";
	case KeyEvent.VK_ENTER:
		return "\n";
	case KeyEvent.VK_SPACE:
		return " ";
	default:
		return "";
	}
}
 
Example 8
Source File: KeyCodeToChar.java    From Repeat with Apache License 2.0 4 votes vote down vote up
private static String getNonAlphaCharWithShift(int code) {
	switch (code) {
	case KeyEvent.VK_BACK_QUOTE:
		return "~";
	case KeyEvent.VK_1:
		return "!";
	case KeyEvent.VK_2:
		return "@";
	case KeyEvent.VK_3:
		return "#";
	case KeyEvent.VK_4:
		return "$";
	case KeyEvent.VK_5:
		return "%";
	case KeyEvent.VK_6:
		return "^";
	case KeyEvent.VK_7:
		return "&";
	case KeyEvent.VK_8:
		return "*";
	case KeyEvent.VK_9:
		return "(";
	case KeyEvent.VK_0:
		return ")";
	case KeyEvent.VK_MINUS:
		return "_";
	case KeyEvent.VK_EQUALS:
		return "+";
	case KeyEvent.VK_OPEN_BRACKET:
		return "{";
	case KeyEvent.VK_CLOSE_BRACKET:
		return "}";
	case KeyEvent.VK_SEMICOLON:
		return ":";
	case KeyEvent.VK_QUOTE:
		return "\"";
	case KeyEvent.VK_BACK_SLASH:
		return "|";
	case KeyEvent.VK_COMMA:
		return "<";
	case KeyEvent.VK_PERIOD:
		return ">";
	case KeyEvent.VK_SLASH:
		return "?";
	case KeyEvent.VK_TAB:
		return "\t";
	case KeyEvent.VK_ENTER:
		return "\n";
	case KeyEvent.VK_SPACE:
		return " ";
	default:
		return "";
	}
}
 
Example 9
Source File: MissingCharsKorean.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
private static boolean setKeyInput(int iCount) {
    boolean inputSet = true;

    switch(iCount) {
        case 0:
            // Input Korean q (#12610) /(#47)
            expectedResults = new int[]{ 12610, 47 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH}
                                    };
            break;

        case 1:
            // Input Korean q (#12610) /(#47) gh (#54840) \(#92)
            expectedResults = new int[]{ 12610, 47, 54840, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        case 2:
            // Input Korean q (#12610) /(#47) ghq (#54857) \(#92)
            expectedResults = new int[]{ 12610, 47, 54857, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_Q},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        case 3:
            // Input Korean q (#12610) /(#47) gh (#54840) \(#92)
            expectedResults = new int[]{ 12610, 47, 54840, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_Q},
                                        {KeyEvent.VK_BACK_SPACE},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        case 4:
            // Input Korean q (#12610) /(#47) g (#12622) \(#92)
            expectedResults = new int[]{ 12610, 47, 12622, 92 };
            inKeyCodes = new int[][] {  {KeyEvent.VK_Q},
                                        {KeyEvent.VK_SLASH},
                                        {KeyEvent.VK_G},
                                        {KeyEvent.VK_H},
                                        {KeyEvent.VK_Q},
                                        {KeyEvent.VK_BACK_SPACE},
                                        {KeyEvent.VK_BACK_SPACE},
                                        {KeyEvent.VK_BACK_SLASH}
                                    };
            break;

        default:
            inputSet = false;
            break;
    }

    return inputSet;
}
 
Example 10
Source File: MacKeymapUtil.java    From consulo with Apache License 2.0 4 votes vote down vote up
public static String getKeyText(int code) {
  switch (code) {
    case KeyEvent.VK_BACK_SPACE:     return BACKSPACE;
    case KeyEvent.VK_ESCAPE:         return ESCAPE;
    case KeyEvent.VK_CAPS_LOCK:      return CAPS_LOCK;
    case KeyEvent.VK_TAB:            return TAB;
    case KeyEvent.VK_SPACE:          return SPACE;
    case KeyEvent.VK_DELETE:         return DELETE;
    case KeyEvent.VK_HOME:           return HOME;
    case KeyEvent.VK_END:            return END;
    case KeyEvent.VK_PAGE_UP:        return PAGE_UP;
    case KeyEvent.VK_PAGE_DOWN:      return PAGE_DOWN;
    case KeyEvent.VK_UP:             return UP;
    case KeyEvent.VK_DOWN:           return DOWN;
    case KeyEvent.VK_LEFT:           return LEFT;
    case KeyEvent.VK_RIGHT:          return RIGHT;
    case KeyEvent.VK_NUM_LOCK:       return NUMBER_LOCK;
    case KeyEvent.VK_ENTER:          return RETURN;
    case KeyEvent.VK_BACK_QUOTE:     return "`";
    case KeyEvent.VK_NUMBER_SIGN:    return NUM_PAD;
    case KeyEvent.VK_MULTIPLY:       return NUM_PAD + " *";
    case KeyEvent.VK_ADD:            return "+";
    case KeyEvent.VK_SEPARATOR:      return ",";
    case KeyEvent.VK_SUBTRACT:       return "-";
    case KeyEvent.VK_DECIMAL:        return ".";
    case KeyEvent.VK_DIVIDE:         return "/";
    case KeyEvent.VK_NUMPAD0:        return "0";
    case KeyEvent.VK_NUMPAD1:        return "1";
    case KeyEvent.VK_NUMPAD2:        return "2";
    case KeyEvent.VK_NUMPAD3:        return "3";
    case KeyEvent.VK_NUMPAD4:        return "4";
    case KeyEvent.VK_NUMPAD5:        return "5";
    case KeyEvent.VK_NUMPAD6:        return "6";
    case KeyEvent.VK_NUMPAD7:        return "7";
    case KeyEvent.VK_NUMPAD8:        return "8";
    case KeyEvent.VK_NUMPAD9:        return "9";
    case KeyEvent.VK_SLASH:          return "/";
    case KeyEvent.VK_BACK_SLASH:     return "\\";
    case KeyEvent.VK_PERIOD:         return ".";
    case KeyEvent.VK_SEMICOLON:      return ";";
    case KeyEvent.VK_CLOSE_BRACKET:  return "]";
    case KeyEvent.VK_OPEN_BRACKET:   return "[";
    case KeyEvent.VK_EQUALS:         return "=";
    case KeyEvent.VK_MINUS:          return "-";
    case KeyEvent.VK_PLUS:           return "+";
    case 0:                          return "fn";
  }
  return KeyEvent.getKeyText(code);
}