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

The following examples show how to use java.awt.event.KeyEvent#VK_BACK_QUOTE . 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: VncClientPacketSender.java    From cosmic with Apache License 2.0 4 votes vote down vote up
private int mapAwtKeyToVncKey(final int key) {
    switch (key) {
        case KeyEvent.VK_BACK_SPACE:
            return 0xff08;
        case KeyEvent.VK_TAB:
            return 0xff09;
        case KeyEvent.VK_ENTER:
            return 0xff0d;
        case KeyEvent.VK_ESCAPE:
            return 0xff1b;
        case KeyEvent.VK_INSERT:
            return 0xff63;
        case KeyEvent.VK_DELETE:
            return 0xffff;
        case KeyEvent.VK_HOME:
            return 0xff50;
        case KeyEvent.VK_END:
            return 0xff57;
        case KeyEvent.VK_PAGE_UP:
            return 0xff55;
        case KeyEvent.VK_PAGE_DOWN:
            return 0xff56;
        case KeyEvent.VK_LEFT:
            return 0xff51;
        case KeyEvent.VK_UP:
            return 0xff52;
        case KeyEvent.VK_RIGHT:
            return 0xff53;
        case KeyEvent.VK_DOWN:
            return 0xff54;
        case KeyEvent.VK_F1:
            return 0xffbe;
        case KeyEvent.VK_F2:
            return 0xffbf;
        case KeyEvent.VK_F3:
            return 0xffc0;
        case KeyEvent.VK_F4:
            return 0xffc1;
        case KeyEvent.VK_F5:
            return 0xffc2;
        case KeyEvent.VK_F6:
            return 0xffc3;
        case KeyEvent.VK_F7:
            return 0xffc4;
        case KeyEvent.VK_F8:
            return 0xffc5;
        case KeyEvent.VK_F9:
            return 0xffc6;
        case KeyEvent.VK_F10:
            return 0xffc7;
        case KeyEvent.VK_F11:
            return 0xffc8;
        case KeyEvent.VK_F12:
            return 0xffc9;
        case KeyEvent.VK_SHIFT:
            return 0xffe1;
        case KeyEvent.VK_CONTROL:
            return 0xffe3;
        case KeyEvent.VK_META:
            return 0xffe7;
        case KeyEvent.VK_ALT:
            return 0xffe9;
        case KeyEvent.VK_ALT_GRAPH:
            return 0xffea;
        case KeyEvent.VK_BACK_QUOTE:
            return 0x0060;
    }

    return key;
}
 
Example 2
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 3
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 4
Source File: VncClientPacketSender.java    From cloudstack with Apache License 2.0 4 votes vote down vote up
private int mapAwtKeyToVncKey(int key) {
    switch (key) {
        case KeyEvent.VK_BACK_SPACE:
            return 0xff08;
        case KeyEvent.VK_TAB:
            return 0xff09;
        case KeyEvent.VK_ENTER:
            return 0xff0d;
        case KeyEvent.VK_ESCAPE:
            return 0xff1b;
        case KeyEvent.VK_INSERT:
            return 0xff63;
        case KeyEvent.VK_DELETE:
            return 0xffff;
        case KeyEvent.VK_HOME:
            return 0xff50;
        case KeyEvent.VK_END:
            return 0xff57;
        case KeyEvent.VK_PAGE_UP:
            return 0xff55;
        case KeyEvent.VK_PAGE_DOWN:
            return 0xff56;
        case KeyEvent.VK_LEFT:
            return 0xff51;
        case KeyEvent.VK_UP:
            return 0xff52;
        case KeyEvent.VK_RIGHT:
            return 0xff53;
        case KeyEvent.VK_DOWN:
            return 0xff54;
        case KeyEvent.VK_F1:
            return 0xffbe;
        case KeyEvent.VK_F2:
            return 0xffbf;
        case KeyEvent.VK_F3:
            return 0xffc0;
        case KeyEvent.VK_F4:
            return 0xffc1;
        case KeyEvent.VK_F5:
            return 0xffc2;
        case KeyEvent.VK_F6:
            return 0xffc3;
        case KeyEvent.VK_F7:
            return 0xffc4;
        case KeyEvent.VK_F8:
            return 0xffc5;
        case KeyEvent.VK_F9:
            return 0xffc6;
        case KeyEvent.VK_F10:
            return 0xffc7;
        case KeyEvent.VK_F11:
            return 0xffc8;
        case KeyEvent.VK_F12:
            return 0xffc9;
        case KeyEvent.VK_SHIFT:
            return 0xffe1;
        case KeyEvent.VK_CONTROL:
            return 0xffe3;
        case KeyEvent.VK_META:
            return 0xffe7;
        case KeyEvent.VK_ALT:
            return 0xffe9;
        case KeyEvent.VK_ALT_GRAPH:
            return 0xffea;
        case KeyEvent.VK_BACK_QUOTE:
            return 0x0060;
    }

    return key;
}
 
Example 5
Source File: InputHandler.java    From JavaGame with GNU Affero General Public License v3.0 4 votes vote down vote up
private void toggleKey(int keyCode, boolean isPressed) {
	if (!isIgnoreInput()) {
		if (keyCode == KeyEvent.VK_Z && isAzertyCountry || keyCode == KeyEvent.VK_W && !isAzertyCountry
				|| keyCode == KeyEvent.VK_UP) {
			up.toggle(isPressed);
		}

		if (keyCode == KeyEvent.VK_Q && isAzertyCountry || keyCode == KeyEvent.VK_A && !isAzertyCountry
				|| keyCode == KeyEvent.VK_LEFT) {
			left.toggle(isPressed);
		}

		if (keyCode == KeyEvent.VK_S || keyCode == KeyEvent.VK_DOWN) {
			down.toggle(isPressed);
		}

		if (keyCode == KeyEvent.VK_D || keyCode == KeyEvent.VK_RIGHT) {
			right.toggle(isPressed);
		}
	}
	if (isIgnoreInput()) {
		up.toggle(false);
		down.toggle(false);
		left.toggle(false);
		right.toggle(false);
	}

	if (keyCode == KeyEvent.VK_M) {
		if(!toggleMusic){
			Game.getBackgroundMusic().play();
			print.print("Playing Music", PrintTypes.MUSIC);
			toggleMusic = true;
		}
	}

	if (keyCode == KeyEvent.VK_COMMA) {
		Game.getBackgroundMusic().stop();
		if(toggleMusic)
			print.print("Stopping Music", PrintTypes.MUSIC);
			toggleMusic = false;
	}


	if (keyCode == KeyEvent.VK_W && isAzertyCountry || keyCode == KeyEvent.VK_Z && !isAzertyCountry) {
		// if (map == 0){
		// Game.getGame().setMap("/levels/water_level.png");
		// map++;
		// } else{
		// Game.getGame().setMap("/levels/custom_level.png");
		// map--;
		// }
		if (Game.getMap() == 2) {
			if (Game.isNpc()) {
				Game.setNpc(false);
			}
			Game.setChangeLevel(true);
		}
	}
	if (keyCode == KeyEvent.VK_N) {
		if (Game.getPlayer().isMoving()) {
			setIgnoreInput(true);
			int n = popup.Warn("Stop moving before spawning dummy AI");
			if (n == 0) {
				setIgnoreInput(false);
			}
			return;
		}
		if (!Game.isNpc()) {
			Game.setNpc(true);
			Game.npcSpawn();
			print.print("Dummy has been spawned", PrintTypes.GAME);
		}
	}
	if (keyCode == KeyEvent.VK_K) {
		if (Game.isNpc()) {
			Game.setNpc(false);
			Game.npcKill();
			print.print("Dummy has been removed", PrintTypes.GAME);
		}
	}

	if (keyCode == KeyEvent.VK_A && isAzertyCountry || keyCode == KeyEvent.VK_Q && !isAzertyCountry)
		this.quitGame();

	if (keyCode == KeyEvent.VK_BACK_QUOTE) {
		if (!Game.isClosing() && !Game.isDevMode()) {
			Game.setDevMode(true);
			new Thread(new SleepThread());
		}
	}
}
 
Example 6
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);
}