Posted April 29, 20205 yr Using 1.15.2 forge, how would I detect if a key (e.g R) was pressed? I tried GuiScreenEvent.KeyboardKeyPressedEvent and InputEvent.KeyInputEvent, they just fire twice and when I hold the key it fires lots of times.
April 29, 20205 yr First, use a key binding. Second, using KeyInputEvent allows you to get the key action (pressed, held, released).
April 29, 20205 yr Author 31 minutes ago, ChampionAsh5357 said: First, use a key binding. Second, using KeyInputEvent allows you to get the key action (pressed, held, released). So KeyBinding is like keyBindings[0] = new KeyBinding("Blabla..", KeyValue, "blabla"); It was working in 1.12 but there is no org.lwjgl.input.Keyboard to use in 1.15 forge
April 29, 20205 yr 51 minutes ago, Scholler said: So KeyBinding is like keyBindings[0] = new KeyBinding("Blabla..", KeyValue, "blabla"); It was working in 1.12 but there is no org.lwjgl.input.Keyboard to use in 1.15 forge No... create a static KeyBinding and instantiate it in FMLClientSetupEvent. In the same event, register it to the client using ClientRegistry::registerKeyBinding
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.