当前位置: 首页>>代码示例>>Java>>正文


Java Keyboard.KEY_HOME属性代码示例

本文整理汇总了Java中org.lwjgl.input.Keyboard.KEY_HOME属性的典型用法代码示例。如果您正苦于以下问题:Java Keyboard.KEY_HOME属性的具体用法?Java Keyboard.KEY_HOME怎么用?Java Keyboard.KEY_HOME使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.lwjgl.input.Keyboard的用法示例。


在下文中一共展示了Keyboard.KEY_HOME属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: keyTyped

@Override
public void keyTyped(char eventChar, int eventKey)
{
    if (enabled() || eventKey == Keyboard.KEY_LEFT || eventKey == Keyboard.KEY_RIGHT || eventKey == Keyboard.KEY_HOME || eventKey == Keyboard.KEY_END)
    {
        this.textFieldValue.textboxKeyTyped((enabled() ? eventChar : Keyboard.CHAR_NONE), eventKey);

        if (configElement.getValidationPattern() != null)
        {
            if (configElement.getValidationPattern().matcher(this.textFieldValue.getText().trim()).matches())
                isValidValue = true;
            else
                isValidValue = false;
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:16,代码来源:GuiConfigEntries.java

示例2: keyTyped

@Override
public void keyTyped(char eventChar, int eventKey)
{
    if (owningScreen.enabled || eventKey == Keyboard.KEY_LEFT || eventKey == Keyboard.KEY_RIGHT
            || eventKey == Keyboard.KEY_HOME || eventKey == Keyboard.KEY_END)
    {
        this.textFieldValue.textboxKeyTyped((owningScreen.enabled ? eventChar : Keyboard.CHAR_NONE), eventKey);

        if (configElement.getValidationPattern() != null)
        {
            if (configElement.getValidationPattern().matcher(this.textFieldValue.getText().trim()).matches())
                isValidValue = true;
            else
                isValidValue = false;
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:17,代码来源:GuiEditArrayEntries.java

示例3: keyTyped

@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
    super.keyTyped(typedChar, keyCode);
    if (keyCode == Keyboard.KEY_BACK) {
        if (!text.isEmpty() && cursor > 0) {
            text = text.substring(0, cursor-1) + text.substring(cursor);
            cursor--;
        }
    } else if (keyCode == Keyboard.KEY_DELETE) {
        if (cursor < text.length()) {
            text = text.substring(0, cursor) + text.substring(cursor+1);
        }
    } else if (keyCode == Keyboard.KEY_HOME) {
        cursor = 0;
    } else if (keyCode == Keyboard.KEY_END) {
        cursor = text.length();
    } else if (keyCode == Keyboard.KEY_LEFT) {
        if (cursor > 0) {
            cursor--;
        }
    } else if (keyCode == Keyboard.KEY_RIGHT) {
        if (cursor < text.length()) {
            cursor++;
        }
    } else if (keyCode == Keyboard.KEY_ESCAPE) {
        close();
    } else if (keyCode == Keyboard.KEY_RETURN) {
        destination = new TeleportDestination(text, destination.getDimension(), destination.getPos(), destination.getSide());
        MeeCreepsMessages.INSTANCE.sendToServer(new PacketSetDestination(destination, destinationIndex));
        close();
    } else if (typedChar != 0) {
        if (text.length() < 15) {
            text = text.substring(0, cursor) + typedChar + text.substring(cursor);
            cursor++;
        }
    }
}
 
开发者ID:McJty,项目名称:MeeCreeps,代码行数:37,代码来源:GuiAskName.java

示例4: keyTyped

@Override
public void keyTyped(char c, int key) {
    if (key == Keyboard.KEY_ESCAPE || key == Keyboard.KEY_RETURN) {
        setFocused(false);
    } else {
        String value = (String) getValue();
        if (key == Keyboard.KEY_BACK) {
            if (cursor == 0) return;
            --cursor;
            setValue(value.substring(0, cursor)
                    +value.substring(cursor+1,value.length()));
        } else if (key == Keyboard.KEY_DELETE) {
            if (cursor == value.length()) return;
            setValue(value.substring(0, cursor)
                    +value.substring(cursor+1,value.length()));
        } else if (key == Keyboard.KEY_HOME) {
            cursor = 0;
        } else if (key == Keyboard.KEY_END) {
            cursor = value.length();
        } else if (key == Keyboard.KEY_LEFT) {
            if (cursor > 0) --cursor;
        } else if (key == Keyboard.KEY_RIGHT) {
            if (cursor < value.length()) ++cursor;
        } else if (c != Keyboard.CHAR_NONE) {
            setValue(value.substring(0, cursor)+c
                    +value.substring(cursor,value.length()));
            ++cursor;
        }
        // TODO: selection, ^X, ^C, ^V
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:31,代码来源:TextField.java

示例5: keyTyped

@Override
public void keyTyped(final char eventChar, final int eventKey) {
	if (enabled()||eventKey==Keyboard.KEY_LEFT||eventKey==Keyboard.KEY_RIGHT||eventKey==Keyboard.KEY_HOME||eventKey==Keyboard.KEY_END) {
		this.textFieldValue.textboxKeyTyped(enabled() ? eventChar : Keyboard.CHAR_NONE, eventKey);

		try {
			Charset.forName(this.textFieldValue.getText());
			this.isValidValue = true;
		} catch (final Exception e) {
			this.isValidValue = false;
		}
	}
}
 
开发者ID:Team-Fruit,项目名称:McHeliPrivacyShield,代码行数:13,代码来源:Config.java

示例6: keyTyped

@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
    super.keyTyped(typedChar, keyCode);
    if (keyCode == Keyboard.KEY_SPACE || keyCode == Keyboard.KEY_RIGHT) {
        pageInc();
    } else if (keyCode == Keyboard.KEY_LEFT || keyCode == Keyboard.KEY_BACK) {
        pageDec();
    } else if (keyCode == Keyboard.KEY_HOME) {
        pageFront();
    }
}
 
开发者ID:McJty,项目名称:Lector,代码行数:11,代码来源:GuiManual.java


注:本文中的org.lwjgl.input.Keyboard.KEY_HOME属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。