本文整理匯總了Java中java.awt.event.KeyEvent.VK_SLASH屬性的典型用法代碼示例。如果您正苦於以下問題:Java KeyEvent.VK_SLASH屬性的具體用法?Java KeyEvent.VK_SLASH怎麽用?Java KeyEvent.VK_SLASH使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.awt.event.KeyEvent
的用法示例。
在下文中一共展示了KeyEvent.VK_SLASH屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: enter
public void enter()
{
if (ChatString.length() > 0)
{
if (ChatString.charAt(0) == KeyEvent.VK_SLASH) // Command
{
try
{
processCommand();
}
catch (Exception e)
{
System.err.println("Bad command - " + ChatString);
}
}
else if (ChatString.charAt(0) == KeyEvent.VK_SEMICOLON) // Team Chat
{
if (ChatString.length() > 1)
{
ChatString = ChatString.substring(1);
AddMessage(game.gamePlayer.Name + " (TO TEAM) > "
+ ChatString, getColor(game.gamePlayer.Team));
if (game.gameNetCode != null)
game.gameNetCode.SendTCP("teamchat " + ChatString);
}
ChatString = "";
}
else
{
AddMessage(game.gamePlayer.Name + " > " + ChatString,
getColor(game.gamePlayer.Team));
if (game.gameNetCode != null)
game.gameNetCode.SendTCP("broadcast " + ChatString);
ChatString = "";
}
}
}
示例2: setKeyInput
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;
}