本文整理汇总了Java中org.lwjgl.input.Keyboard.isRepeatEvent方法的典型用法代码示例。如果您正苦于以下问题:Java Keyboard.isRepeatEvent方法的具体用法?Java Keyboard.isRepeatEvent怎么用?Java Keyboard.isRepeatEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.input.Keyboard
的用法示例。
在下文中一共展示了Keyboard.isRepeatEvent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dispatchKeypresses
import org.lwjgl.input.Keyboard; //导入方法依赖的package包/类
public void dispatchKeypresses()
{
int i = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() + 256 : Keyboard.getEventKey();
if (i != 0 && !Keyboard.isRepeatEvent())
{
if (!(this.currentScreen instanceof GuiControls) || ((GuiControls)this.currentScreen).time <= getSystemTime() - 20L)
{
if (Keyboard.getEventKeyState())
{
if (i == this.gameSettings.keyBindFullscreen.getKeyCode())
{
this.toggleFullscreen();
}
else if (i == this.gameSettings.keyBindScreenshot.getKeyCode())
{
this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight, this.framebufferMc));
}
}
}
}
}
示例2: dispatchKeypresses
import org.lwjgl.input.Keyboard; //导入方法依赖的package包/类
public void dispatchKeypresses()
{
int i = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() + 256 : Keyboard.getEventKey();
if (i != 0 && !Keyboard.isRepeatEvent())
{
if (!(this.currentScreen instanceof GuiControls) || ((GuiControls)this.currentScreen).time <= getSystemTime() - 20L)
{
if (Keyboard.getEventKeyState())
{
if (this.gameSettings.keyBindFullscreen.isActiveAndMatches(i))
{
this.toggleFullscreen();
}
else if (this.gameSettings.keyBindScreenshot.isActiveAndMatches(i))
{
this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight, this.framebufferMc));
}
}
else if (this.currentScreen instanceof GuiControls) ((GuiControls)this.currentScreen).buttonId = null;
}
}
}
示例3: dispatchKeypresses
import org.lwjgl.input.Keyboard; //导入方法依赖的package包/类
public void dispatchKeypresses() {
int i = Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() : Keyboard.getEventKey();
if (i != 0 && !Keyboard.isRepeatEvent()) {
if (!(this.currentScreen instanceof GuiControls)
|| ((GuiControls) this.currentScreen).time <= getSystemTime() - 20L) {
if (Keyboard.getEventKeyState()) {
if (i == this.gameSettings.keyBindStreamStartStop.getKeyCode()) {
if (this.getTwitchStream().isBroadcasting()) {
this.getTwitchStream().stopBroadcasting();
} else if (this.getTwitchStream().isReadyToBroadcast()) {
this.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback() {
public void confirmClicked(boolean result, int id) {
if (result) {
Minecraft.this.getTwitchStream().func_152930_t();
}
Minecraft.this.displayGuiScreen((GuiScreen) null);
}
}, I18n.format("stream.confirm_start", new Object[0]), "", 0));
} else if (this.getTwitchStream().func_152928_D() && this.getTwitchStream().func_152936_l()) {
if (this.theWorld != null) {
this.ingameGUI.getChatGUI()
.printChatMessage(new ChatComponentText("Not ready to start streaming yet!"));
}
} else {
GuiStreamUnavailable.func_152321_a(this.currentScreen);
}
} else if (i == this.gameSettings.keyBindStreamPauseUnpause.getKeyCode()) {
if (this.getTwitchStream().isBroadcasting()) {
if (this.getTwitchStream().isPaused()) {
this.getTwitchStream().unpause();
} else {
this.getTwitchStream().pause();
}
}
} else if (i == this.gameSettings.keyBindStreamCommercials.getKeyCode()) {
if (this.getTwitchStream().isBroadcasting()) {
this.getTwitchStream().requestCommercial();
}
} else if (i == this.gameSettings.keyBindStreamToggleMic.getKeyCode()) {
this.stream.muteMicrophone(true);
} else if (i == this.gameSettings.keyBindFullscreen.getKeyCode()) {
this.toggleFullscreen();
} else if (i == this.gameSettings.keyBindScreenshot.getKeyCode()) {
this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir,
this.displayWidth, this.displayHeight, this.framebufferMc));
}
} else if (i == this.gameSettings.keyBindStreamToggleMic.getKeyCode()) {
this.stream.muteMicrophone(false);
}
}
}
}