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

The following examples show how to use java.awt.event.KeyEvent#VK_J . 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: Plane.java    From JavaGame with MIT License 6 votes vote down vote up
/**
 * ���¼��̵ķ���
 * 
 * @param e
 */
public void keyPressed(KeyEvent e) {
	switch (e.getKeyCode()) {
	case KeyEvent.VK_A:
		left = true;
		break;
	case KeyEvent.VK_S:
		down = true;
		break;
	case KeyEvent.VK_D:
		right = true;
		break;
	case KeyEvent.VK_W:
		up = true;
		break;
	case KeyEvent.VK_J:// ���ӵ�
		superFire = false;
		fire = true;
		break;
	case KeyEvent.VK_SPACE:// �������ӵ�
		fire = false;
		superFire = true;
		break;
	}
}
 
Example 2
Source File: Plane.java    From JavaGame with MIT License 6 votes vote down vote up
/**
 * �ɿ����̵ķ���
 * 
 * @param e
 *            �����¼�
 */
public void keyReleased(KeyEvent e) {
	switch (e.getKeyCode()) {
	case KeyEvent.VK_A:
		left = false;
		break;
	case KeyEvent.VK_S:
		down = false;
		break;
	case KeyEvent.VK_D:
		right = false;
		break;
	case KeyEvent.VK_W:
		up = false;
		break;
	case KeyEvent.VK_J:// ���ӵ�
		fire = false;
		break;
	}
}
 
Example 3
Source File: Plane.java    From JavaGame with MIT License 6 votes vote down vote up
/**
 * ���¼��̵ķ���
 * 
 * @param e
 */
public void keyPressed(KeyEvent e) {
	switch (e.getKeyCode()) {
	case KeyEvent.VK_A:
		left = true;
		break;
	case KeyEvent.VK_S:
		down = true;
		break;
	case KeyEvent.VK_D:
		right = true;
		break;
	case KeyEvent.VK_W:
		up = true;
		break;
	case KeyEvent.VK_J:// ���ӵ�
		superFire = false;
		fire = true;
		break;
	case KeyEvent.VK_SPACE:// �������ӵ�
		fire = false;
		superFire = true;
		break;
	}
}
 
Example 4
Source File: Plane.java    From JavaGame with MIT License 6 votes vote down vote up
/**
 * �ɿ����̵ķ���
 * 
 * @param e
 *            �����¼�
 */
public void keyReleased(KeyEvent e) {
	switch (e.getKeyCode()) {
	case KeyEvent.VK_A:
		left = false;
		break;
	case KeyEvent.VK_S:
		down = false;
		break;
	case KeyEvent.VK_D:
		right = false;
		break;
	case KeyEvent.VK_W:
		up = false;
		break;
	case KeyEvent.VK_J:// ���ӵ�
		fire = false;
		break;
	}
}
 
Example 5
Source File: CreateTestsAction.java    From netbeans with Apache License 2.0 4 votes vote down vote up
/** creates new CreateTestsAction instance */
public CreateTestsAction() {
    super(MENU, MENU, new Action.Shortcut(KeyEvent.CTRL_MASK|KeyEvent.ALT_MASK, KeyEvent.VK_J));
}
 
Example 6
Source File: JumpToSearchCommand.java    From gcs with Mozilla Public License 2.0 4 votes vote down vote up
private JumpToSearchCommand() {
    super(I18n.Text("Jump To Search"), null, KeyEvent.VK_J);
}
 
Example 7
Source File: Robot.java    From xnx3 with Apache License 2.0 4 votes vote down vote up
/**
 * 将字符型转换为按键码,可直接使用 {@link #press(int)}调用
 * @param key 字符型文字,包含 0~9 a~z .
 * @return 按键码
 */
public int StringToKey(String key){
	switch (key) {
	case "a":
		return KeyEvent.VK_A;
	case "b":
		return KeyEvent.VK_B;
	case "c":
		return KeyEvent.VK_C;
	case "d":
		return KeyEvent.VK_D;
	case "e":
		return KeyEvent.VK_E;
	case "f":
		return KeyEvent.VK_F;
	case "g":
		return KeyEvent.VK_G;
	case "h":
		return KeyEvent.VK_H;
	case "i":
		return KeyEvent.VK_I;
	case "j":
		return KeyEvent.VK_J;
	case "k":
		return KeyEvent.VK_K;
	case "l":
		return KeyEvent.VK_L;
	case "m":
		return KeyEvent.VK_M;
	case "n":
		return KeyEvent.VK_N;
	case "o":
		return KeyEvent.VK_O;
	case "p":
		return KeyEvent.VK_P;
	case "q":
		return KeyEvent.VK_Q;
	case "r":
		return KeyEvent.VK_R;
	case "s":
		return KeyEvent.VK_S;
	case "t":
		return KeyEvent.VK_T;
	case "u":
		return KeyEvent.VK_U;
	case "v":
		return KeyEvent.VK_V;
	case "w":
		return KeyEvent.VK_W;
	case "x":
		return KeyEvent.VK_X;
	case "y":
		return KeyEvent.VK_Y;
	case "z":
		return KeyEvent.VK_Z;
	case "0":
		return KeyEvent.VK_0;
	case "1":
		return KeyEvent.VK_1;
	case "2":
		return KeyEvent.VK_2;
	case "3":
		return KeyEvent.VK_3;
	case "4":
		return KeyEvent.VK_4;
	case "5":
		return KeyEvent.VK_5;
	case "6":
		return KeyEvent.VK_6;
	case "7":
		return KeyEvent.VK_7;
	case "8":
		return KeyEvent.VK_8;
	case "9":
		return KeyEvent.VK_9;
	case ".":
		return KeyEvent.VK_PERIOD;
	default:
		break;
	}
	
	return 0;
}
 
Example 8
Source File: KeyCodeToChar.java    From Repeat with Apache License 2.0 4 votes vote down vote up
private static String getLowerCaseAlphaChar(int code) {
	switch (code) {
	case KeyEvent.VK_Q:
		return "q";
	case KeyEvent.VK_W:
		return "w";
	case KeyEvent.VK_E:
		return "e";
	case KeyEvent.VK_R:
		return "r";
	case KeyEvent.VK_T:
		return "t";
	case KeyEvent.VK_Y:
		return "y";
	case KeyEvent.VK_U:
		return "u";
	case KeyEvent.VK_I:
		return "i";
	case KeyEvent.VK_O:
		return "o";
	case KeyEvent.VK_P:
		return "p";
	case KeyEvent.VK_A:
		return "a";
	case KeyEvent.VK_S:
		return "s";
	case KeyEvent.VK_D:
		return "d";
	case KeyEvent.VK_F:
		return "f";
	case KeyEvent.VK_G:
		return "g";
	case KeyEvent.VK_H:
		return "h";
	case KeyEvent.VK_J:
		return "j";
	case KeyEvent.VK_K:
		return "k";
	case KeyEvent.VK_L:
		return "l";
	case KeyEvent.VK_Z:
		return "z";
	case KeyEvent.VK_X:
		return "x";
	case KeyEvent.VK_C:
		return "c";
	case KeyEvent.VK_V:
		return "v";
	case KeyEvent.VK_B:
		return "b";
	case KeyEvent.VK_N:
		return "n";
	case KeyEvent.VK_M:
		return "m";
	default:
		return "";
	}
}
 
Example 9
Source File: KeyCodeToChar.java    From Repeat with Apache License 2.0 4 votes vote down vote up
private static String getUpperCaseAlphaChar(int code) {
	switch (code) {
	case KeyEvent.VK_Q:
		return "Q";
	case KeyEvent.VK_W:
		return "W";
	case KeyEvent.VK_E:
		return "E";
	case KeyEvent.VK_R:
		return "R";
	case KeyEvent.VK_T:
		return "T";
	case KeyEvent.VK_Y:
		return "Y";
	case KeyEvent.VK_U:
		return "U";
	case KeyEvent.VK_I:
		return "I";
	case KeyEvent.VK_O:
		return "O";
	case KeyEvent.VK_P:
		return "P";
	case KeyEvent.VK_A:
		return "A";
	case KeyEvent.VK_S:
		return "S";
	case KeyEvent.VK_D:
		return "D";
	case KeyEvent.VK_F:
		return "F";
	case KeyEvent.VK_G:
		return "G";
	case KeyEvent.VK_H:
		return "H";
	case KeyEvent.VK_J:
		return "J";
	case KeyEvent.VK_K:
		return "K";
	case KeyEvent.VK_L:
		return "L";
	case KeyEvent.VK_Z:
		return "Z";
	case KeyEvent.VK_X:
		return "X";
	case KeyEvent.VK_C:
		return "C";
	case KeyEvent.VK_V:
		return "V";
	case KeyEvent.VK_B:
		return "B";
	case KeyEvent.VK_N:
		return "N";
	case KeyEvent.VK_M:
		return "M";
	default:
		return "";
	}
}