cpw.mods.fml.common.gameevent.InputEvent Java Examples
The following examples show how to use
cpw.mods.fml.common.gameevent.InputEvent.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KeyInputHandler.java From AdvancedMod with GNU General Public License v3.0 | 5 votes |
@SubscribeEvent public void handleKeyInputEvent(InputEvent.KeyInputEvent event){ Keybindings key = getPressedKey(); if(key != null) { switch(key){ case EXPLODE: NetworkHandler.sendToServer(new MessageExplode(3)); break; case EXPLODE_BIG: NetworkHandler.sendToServer(new MessageExplode(30)); break; } } }
Example #2
Source File: KeyHandler.java From SimplyJetpacks with MIT License | 5 votes |
@SubscribeEvent public void onKey(InputEvent evt) { if (!mc.inGameHasFocus) { return; } for (SJKeyBinding key : keyBindings) { if (key.isPressed()) { key.handleKeyPress(); } } }
Example #3
Source File: GuiKeybindCheckBox.java From PneumaticCraft with GNU General Public License v3.0 | 5 votes |
@SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event){ Minecraft mc = FMLClientHandler.instance().getClient(); if(mc.inGameHasFocus && keyBinding != null && keyBinding.isPressed()) { onMouseClicked(0, 0, 0); HUDHandler.instance().addMessage(I18n.format("pneumaticHelmet.message." + (checked ? "enable" : "disable") + "Setting", I18n.format(text)), new ArrayList<String>(), 60, 0x7000AA00); } }
Example #4
Source File: MwKeyHandler.java From mapwriter with MIT License | 5 votes |
@SubscribeEvent public void onKeyPress(InputEvent.KeyInputEvent event){ if(keyMapGui.getIsKeyPressed()){ KeyBinding.setKeyBindState(keyMapGui.getKeyCode(), false); Mw.instance.onKeyDown(keyMapGui); } if(keyNewMarker.getIsKeyPressed()){ KeyBinding.setKeyBindState(keyNewMarker.getKeyCode(), false); Mw.instance.onKeyDown(keyNewMarker); } if(keyMapMode.getIsKeyPressed()){ KeyBinding.setKeyBindState(keyMapMode.getKeyCode(), false); Mw.instance.onKeyDown(keyMapMode); } if(keyNextGroup.getIsKeyPressed()){ KeyBinding.setKeyBindState(keyNextGroup.getKeyCode(), false); Mw.instance.onKeyDown(keyNextGroup); } if(keyTeleport.getIsKeyPressed()){ KeyBinding.setKeyBindState(keyTeleport.getKeyCode(), false); Mw.instance.onKeyDown(keyTeleport); } if(keyZoomIn.getIsKeyPressed()){ KeyBinding.setKeyBindState(keyZoomIn.getKeyCode(), false); Mw.instance.onKeyDown(keyZoomIn); } if(keyZoomOut.getIsKeyPressed()){ KeyBinding.setKeyBindState(keyZoomOut.getKeyCode(), false); Mw.instance.onKeyDown(keyZoomOut); } if(keyUndergroundMode.getIsKeyPressed()){ KeyBinding.setKeyBindState(keyUndergroundMode.getKeyCode(), false); Mw.instance.onKeyDown(keyUndergroundMode); } }
Example #5
Source File: KeyInputEventHandler.java From LetsModReboot with GNU General Public License v3.0 | 4 votes |
@SubscribeEvent public void handleKeyInputEvent(InputEvent.KeyInputEvent event) { LogHelper.info(getPressedKeybinding()); }
Example #6
Source File: ShipKeyHandler.java From archimedes-ships with MIT License | 4 votes |
@SubscribeEvent public void keyPress(InputEvent.KeyInputEvent e) { }