本文整理匯總了Java中java.awt.event.KeyEvent.VK_SEMICOLON屬性的典型用法代碼示例。如果您正苦於以下問題:Java KeyEvent.VK_SEMICOLON屬性的具體用法?Java KeyEvent.VK_SEMICOLON怎麽用?Java KeyEvent.VK_SEMICOLON使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.awt.event.KeyEvent
的用法示例。
在下文中一共展示了KeyEvent.VK_SEMICOLON屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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 = "";
}
}
}