Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

So i used the KeyBinding class (net.minecraft.client.settings.KeyBinding) to add a new keybind but it only triggers when i am not in a gui, i am new to forge and what not so im not sure how i could fix this issue?

  • Author
59 minutes ago, diesieben07 said:

That is normal, key bindings are disabled in a Screen.

Check out the various keyboard related events in GuiScreenEvent for detecting keyboard input while a screen is open.

Note that this might not be a good idea, due to for example text input fields.

I see like for JEI they could type something and it would trigger what ever i am trying to do.

  • 9 months later...

Resurrecting this thread to ask:

Is there a way to enable keybindings while in a GUI?

I've been able to use GuiScreenEvent.KeyboardKeyEvent but for detecting held buttons it has a delay after the initial press, just like when holding down a button to repeat the same character while typing. The same is true for getGui().keyPressed(). However, keybindings do not have this issue and are guaranteed to execute code smoothly when a key is held.

I've noticed that some GUI screens do in fact allow keybindings when open, like the player inventory screen. Is there a way to also allow use of keybindings on custom GUIs?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.