當前位置: 首頁>>代碼示例>>Java>>正文


Java Keyboard.getEventCharacter方法代碼示例

本文整理匯總了Java中org.lwjgl.input.Keyboard.getEventCharacter方法的典型用法代碼示例。如果您正苦於以下問題:Java Keyboard.getEventCharacter方法的具體用法?Java Keyboard.getEventCharacter怎麽用?Java Keyboard.getEventCharacter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.lwjgl.input.Keyboard的用法示例。


在下文中一共展示了Keyboard.getEventCharacter方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: func_146282_l

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
@Override
public void func_146282_l() {
    if (Bit.getInstance() == null) {
        return;
    }
    int key = Keyboard.getEventKey();
    char cha = Keyboard.getEventCharacter();
    if (key == Keyboard.KEY_NONE) return;

    if (key == Keyboard.KEY_ESCAPE && Keyboard.getEventKeyState()) {
        Wrapper.displayGuiScreen(null);
        return;
    }

    if (key == Keyboard.KEY_F11) Wrapper.getMinecraft().func_71352_k();

    Iterator<Window> iter = Bit.getInstance().getClickGui().getWindows().iterator();
    while (iter.hasNext()) {
        Window comp = iter.next();
        if (Keyboard.getEventKeyState())
            comp.keyPress(key, cha);
        else
            comp.keyRelease(key, cha);
    }
}
 
開發者ID:Ygore,項目名稱:bit-client,代碼行數:26,代碼來源:ClickGuiDisplayer.java

示例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 (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));
                }
            }
        }
    }
}
 
開發者ID:NSExceptional,項目名稱:Zombe-Modpack,代碼行數:23,代碼來源:Minecraft.java

示例3: 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;
        }
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:24,代碼來源:Minecraft.java

示例4: onKeyEvent

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
@Inject(method = "runTickKeyboard", at = @At(value = "INVOKE_ASSIGN", target = "org/lwjgl/input/Keyboard.getEventKeyState()Z", remap = false))
private void onKeyEvent(CallbackInfo ci) {
    if (currentScreen != null)
        return;

    boolean down = Keyboard.getEventKeyState();
    int key = Keyboard.getEventKey();
    char ch = Keyboard.getEventCharacter();

    ClientAPI.EVENT_BUS.post(down ? new KeyEvent(key, ch) : new KeyUpEvent(key, ch));
}
 
開發者ID:ImpactDevelopment,項目名稱:ClientAPI,代碼行數:12,代碼來源:MixinMinecraft.java

示例5: mapKeyChar

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
public static char mapKeyChar()
{
	switch(Keyboard.getEventKey()) 
	{
       	case Keyboard.KEY_SPACE: return ' ';
       	default: return Keyboard.getEventCharacter();
       }
}
 
開發者ID:ec-europa,項目名稱:sumo,代碼行數:9,代碼來源:EventHelper.java

示例6: handleKeyboardInput

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
public void handleKeyboardInput() {
    int key = Keyboard.getEventKey();
    char keyChar = Keyboard.getEventCharacter();
    if (Keyboard.getEventKeyState()) {
        Gui.instance.keyPress(key, keyChar);
    } else {
        Gui.instance.keyRelease(key, keyChar);
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:10,代碼來源:GuiGrabber.java

示例7: handleKeyboardInput

import org.lwjgl.input.Keyboard; //導入方法依賴的package包/類
/**
 * Handles keyboard input.
 */
public void handleKeyboardInput() throws IOException
{
    char c0 = Keyboard.getEventCharacter();

    if (Keyboard.getEventKey() == 0 && c0 >= 32 || Keyboard.getEventKeyState())
    {
        this.keyTyped(c0, Keyboard.getEventKey());
    }

    this.mc.dispatchKeypresses();
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:15,代碼來源:GuiScreen.java

示例8: 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);
			}
		}
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:55,代碼來源:Minecraft.java


注:本文中的org.lwjgl.input.Keyboard.getEventCharacter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。