本文整理匯總了Java中org.lwjgl.input.Keyboard.KEY_TAB屬性的典型用法代碼示例。如果您正苦於以下問題:Java Keyboard.KEY_TAB屬性的具體用法?Java Keyboard.KEY_TAB怎麽用?Java Keyboard.KEY_TAB使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.lwjgl.input.Keyboard
的用法示例。
在下文中一共展示了Keyboard.KEY_TAB屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onKey
@Override
public boolean onKey(char key, int keyCode) {
if (fixedOptions) return false;
if (enabled && isFocused() && keyCode == Keyboard.KEY_TAB) {//Auto-complete
List<String> applicableElements = getApplicableElements();
if (applicableElements.size() > 0) {
setText(applicableElements.get(0));
listener.onKeyTyped(this);
return true;
} else {
return super.onKey(key, keyCode);
}
} else {
return super.onKey(key, keyCode);
}
}
示例2: keyTyped
protected void keyTyped(char typedChar, int keyCode) throws IOException
{
this.usernameField.textboxKeyTyped(typedChar, keyCode);
this.passwordField.textboxKeyTyped(typedChar, keyCode);
if (this.okButton.enabled && (keyCode == Keyboard.KEY_RETURN || keyCode == Keyboard.KEY_NUMPADENTER))
{
this.actionPerformed(this.okButton);
}
else if (keyCode == Keyboard.KEY_TAB)
{
boolean isUsernameFieldFocused = this.usernameField.isFocused();
boolean isPasswordFieldFocused = this.passwordField.isFocused();
this.usernameField.setFocused(isPasswordFieldFocused);
this.passwordField.setFocused(isUsernameFieldFocused);
}
}
示例3: keyTyped
@Override
protected void keyTyped(char key, int keyCode) throws IOException {
if ((keyCode == Keyboard.KEY_RETURN || keyCode == Keyboard.KEY_TAB) && rangeWidget.isFocused()) {
sendPacketToServer(rangeWidget.getValue());
} else {
super.keyTyped(key, keyCode);
}
}
示例4: keyTyped
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
if(keyCode == Keyboard.KEY_TAB)
{ this.textInput.setMaxStringLength(60);
ArrayList<String> stringList = new ArrayList<>();
if(dictonaryList.isEmpty())
{
stringList.addAll(CommandBase.getListOfStringsMatchingLastWord(HarshenUtils.listOf(this.textInput.getText()), Block.REGISTRY.getKeys()));
for(String s : HarshenUtils.getAllOreDictionaryList())
for(ItemStack stack : OreDictionary.getOres(s))
if(Block.getBlockFromItem(stack.getItem()) != Blocks.AIR)
stringList.add(s);
dictonaryList = CommandBase.getListOfStringsMatchingLastWord(HarshenUtils.listOf(this.textInput.getText()), stringList);
}
if(!dictonaryList.isEmpty())
this.textInput.setText(dictonaryList.get(timeOver++%dictonaryList.size()));
}
else
{
timeOver = 0;
dictonaryList.clear();
}
if(keyCode == Keyboard.KEY_RETURN)
closeGui();
this.textInput.textboxKeyTyped(typedChar, keyCode);
super.keyTyped(typedChar, keyCode);
}
示例5: keyTyped
@Override
protected void keyTyped(char c, int i)
{
channelName.textboxKeyTyped(c, i);
if(channelName.isFocused())
{
if(i == Keyboard.KEY_TAB)
{
isPublicChannel = !isPublicChannel;
for(GuiButton btn : buttonList)
{
if(btn.id == ID_PUBLIC_CHANNEL)
{
btn.displayString = I18n.translateToLocal(isPublicChannel ? "gui.yes" : "gui.no");
break;
}
}
}
if (i == Keyboard.KEY_RETURN)
{
confirm();
}
}
if (i == 1)
{
if(channelName.isFocused())
{
channelName.setText("");
channelName.setFocused(false);
}
else
{
mc.displayGuiScreen(null);
mc.setIngameFocus();
}
}
}
示例6: keyTyped
public void keyTyped(char character, int keyCode) throws IOException {
this.username.textboxKeyTyped(character, keyCode);
this.password.textboxKeyTyped(character, keyCode);
if (keyCode == Keyboard.KEY_TAB) {
this.username.setFocused(!this.username.isFocused());
this.password.setFocused(!this.password.isFocused());
}
if (keyCode == Keyboard.KEY_RETURN) {
actionPerformed((GuiButton) this.buttonList.get(0));
}
}
示例7: keyTyped
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException
{
if (keyCode == mc.gameSettings.keyBindInventory.getKeyCode() || keyCode == Keyboard.KEY_RETURN || keyCode == UHCCompass.instance.keyHandler.getKeyCode(KeyHandler.QUICKCOORDS))
{
try{
int x = Integer.parseInt(xCoord.getText());
int z = Integer.parseInt(zCoord.getText());
UHCCompass.TARGETX_PROPERTY.set(x);
UHCCompass.TARGETZ_PROPERTY.set(z);
}catch(Exception e){
mc.player.sendMessage(new TextComponentTranslation("uhccompass.invalidcoords"));
}
UHCCompass.syncConfig();
this.mc.displayGuiScreen(null);
if (this.mc.currentScreen == null)
{
this.mc.setIngameFocus();
}
} else if(keyCode == Keyboard.KEY_TAB || keyCode == Keyboard.KEY_SPACE){
xCoord.setFocused(!xCoord.isFocused());
zCoord.setFocused(!zCoord.isFocused());
}else if(Character.isDigit(typedChar) || typedChar == '-' || keyCode == Keyboard.KEY_BACK || keyCode == Keyboard.KEY_LEFT || keyCode == Keyboard.KEY_RIGHT){
xCoord.textboxKeyTyped(typedChar, keyCode);
zCoord.textboxKeyTyped(typedChar, keyCode);
}else if (keyCode == 201)
{
this.mc.ingameGUI.getChatGUI().scroll(this.mc.ingameGUI.getChatGUI().getLineCount() - 1);
}
else if (keyCode == 209)
{
this.mc.ingameGUI.getChatGUI().scroll(-this.mc.ingameGUI.getChatGUI().getLineCount() + 1);
}
super.keyTyped(typedChar, keyCode);
}