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


Java Keyboard.KEY_R属性代码示例

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


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

示例1: update

/**
 * Game loop update
 */
public void update() {
	while (Keyboard.next()) {
		if (Keyboard.getEventKeyState()) {
			if (Keyboard.getEventKey() == Keyboard.KEY_Q) {
				// play as a one off sound effect
				oggEffect.playAsSoundEffect(1.0f, 1.0f, false);
			}
			if (Keyboard.getEventKey() == Keyboard.KEY_W) {
				// replace the music thats curretly playing with 
				// the ogg
				oggStream.playAsMusic(1.0f, 1.0f, true);
			}
			if (Keyboard.getEventKey() == Keyboard.KEY_E) {
				// replace the music thats curretly playing with 
				// the mod
				modStream.playAsMusic(1.0f, 1.0f, true);
			}
			if (Keyboard.getEventKey() == Keyboard.KEY_R) {
				// play as a one off sound effect
				aifEffect.playAsSoundEffect(1.0f, 1.0f, false);
			}
			if (Keyboard.getEventKey() == Keyboard.KEY_T) {
				// play as a one off sound effect
				wavEffect.playAsSoundEffect(1.0f, 1.0f, false);
			}
		}
	}
	
	// polling is required to allow streaming to get a chance to
	// queue buffers.
	SoundStore.get().poll(0);
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:35,代码来源:TestUtils.java

示例2: keyTyped

@Override
protected void keyTyped(char key, int keyCode) throws IOException {
    super.keyTyped(key, keyCode);

    if (nameField.isFocused()) {
        return;
    }

    if (Keyboard.KEY_I == keyCode && Loader.isModLoaded(ModIds.IGWMOD)) {
        onIGWAction();
    }
    if (Keyboard.KEY_R == keyCode) {
        if (exportButton.getBounds().contains(lastMouseX, lastMouseY)) {
            NetworkHandler.sendToServer(new PacketGuiButton(0));
        }
    }
    if (Keyboard.KEY_SPACE == keyCode) {
        toggleShowWidgets();
    }
    if (Keyboard.KEY_DELETE == keyCode) {
        IProgWidget widget = programmerUnit.getHoveredWidget(lastMouseX, lastMouseY);
        if (widget != null) {
            te.progWidgets.remove(widget);
            NetworkHandler.sendToServer(new PacketProgrammerUpdate(te));
        }
    }
    if (Keyboard.KEY_Z == keyCode) {
        NetworkHandler.sendToServer(new PacketGuiButton(undoButton.id));
    }
    if (Keyboard.KEY_Y == keyCode) {
        NetworkHandler.sendToServer(new PacketGuiButton(redoButton.id));
    }
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:33,代码来源:GuiProgrammer.java

示例3: init

public static void init() {
    repeatLastMessage = new KeyBinding("key.last_message", KeyConflictContext.IN_GAME, Keyboard.KEY_R, "key.categories.meecreeps");
    ClientRegistry.registerKeyBinding(repeatLastMessage);
}
 
开发者ID:McJty,项目名称:MeeCreeps,代码行数:4,代码来源:KeyBindings.java

示例4: KillAura

public KillAura() {
	super("KillAura", "Automatically attacks players or mobs.", Keyboard.KEY_R, 0xFFFFFF, Category.COMBAT);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:3,代码来源:KillAura.java


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