Applied Energistics 2

Applied Energistics 2

137M Downloads

Unable to open player inventory via Tab key

luaanon opened this issue ยท 5 comments

commented

Describe the bug

When the Tab key is bound to "Open/Close Inventory", there is a conflict with the hardcoded ActionKey.TOGGLE_FOCUS that prevents the player inventory from being opened.

How to reproduce the bug

  1. Bind the Tab key to "Open/Close Inventory".
  2. In game, press Tab to open the player inventory.
  3. Instead of the inventory opening, it silently fails and nothing happens.

Expected behavior

When the Tab key is bound to "Open/Close Inventory", pressing the Tab key should open the player's inventory or at the very least not silently fail.

Additional details

I would propose a two part fix:

  1. Skip the ActionKey.TOGGLE_FOCUS functionality whenever it conflicts with a player's "Open/Close Inventory" key bind. It may be appropriate to log the conflict once and prompt the player to change a keybind or live without focus toggling.
  2. Allow ActionKey.TOGGLE_FOCUS to be changed, whether exposing it in the client.json or some in-game method.

Which minecraft version are you using?

1.18

On which mod loaders does it happen?

Fabric

Crash log

n/a

commented

The key bind was specifically removed because Vanilla's focus switch behavior is hardcoded to the tab key.

The fix is not to change the key or to make it a configurable key bind again. Instead, we need to use Vanilla's focusing behavior properly so that tabbing through elements in a screen just happens to focus the search field first. (Vanilla will trigger the focus change first, but then still call the open/close inventory keybind after that).

commented

p.s.: When I was testing this, opening inventories with the tab key actually works fine. It's that closing the inventory in an AE screen doesn't work.

commented

I've added a pull request to temporarily fix this issue by assigning the ActionKey.TOGGLE_FOCUS to equals sign (=) from tab. This fix would only apply until a client changeable keybind is added.

commented

Can reproduce this with Tab bound to the default List Players (aka tab list). Pressing Tab key with 10.0.0-alpha.2 with no configuration changes results in no tab list being displayed. Breaks default/vanilla behaviour.

commented

Thank you for taking care of this so incisively! I admit I wasn't expecting this much care and attention to be devoted to this. My bandaid fix was fairly put to shame. Again, many thanks!