MinecraftMachina / ManyMC

📦 A familiar Minecraft Launcher with native support for macOS arm64 (M1)
GNU General Public License v3.0
500 stars 19 forks source link

[1.18.2] [Fabric 0.14.8] "Failed to create window: ... GLFW error 65540: Invalid scancode -1" #76

Closed unilock closed 2 years ago

unilock commented 2 years ago

I tried basic troubleshooting first

Describe the bug

When starting the modpack All of Fabric 5 via ManyMC, the game loads for about a minute, then stalls after Failed to create window: ... GLFW error 65540: Invalid scancode -1. The game then doesn't close until killed.

To reproduce

Steps to reproduce the behavior:

  1. Install All of Fabric 5 v1.3.0
  2. Start the modpack
  3. Game loads for a bit in the background
  4. GLFW error is thrown
  5. Game stalls until killed

Expected behavior

The modpack loads as normal, brings me to the title screen, allows me to join a world, etc.

Logs

https://mclo.gs/WZhoYzn

Screenshots

N/A

System configuration

Additional context

Changing the LWJGL 3 version from 3.2.2 to 3.3.1 did not help. A "vanilla" instance of Minecraft 1.18.2 with Fabric 0.14.8 installed starts and runs without issue.

ViRb3 commented 2 years ago

Just tested and works fine here. Try closing ManyMC and deleting your cached libraries to force them to re-download:

rm -r ~"/Library/Application Support/ManyMC/libraries/"

Make sure you're not using any custom native libraries, wrapper hacks, etc.

Otherwise, seems like this may be a bug with your physical keyboard? https://github.com/fyne-io/fyne/issues/1024

unilock commented 2 years ago

@ViRb3 Deleting the cached libraries didn't help, unfortunately.

Otherwise, seems like this may be a bug with your physical keyboard?

This would be absolutely ridiculous, but not really surprising. Technology is bizarre.

Out of curiosity, could you share a screenshot of your "Keyboard" preference pane for me? This is mine:

Screen Shot 2022-07-26 at 1 08 54 PM

I'm thinking the "Touch Bar shows..." and "Use F1, F2, etc. keys as standard function keys..." settings might have something to do with the problem.

ViRb3 commented 2 years ago

Screen Shot 2022-07-26 at 18 21 50

What touch bar? Are you on a M2 MacBook Pro?

unilock commented 2 years ago

I'm on an M1 MacBook Pro. I was thinking that mirroring your keyboard settings might've at least given a common baseline to test against, but alas.

ViRb3 commented 2 years ago

~But the M1 MacBook Pro does not have a touch bar?~ Nevermind, the 13" one does.

No much idea apart from that I'm afraid. Does non-modded Minecraft work? Maybe it's a mod in the modpack that conflicts with your system. If it's a mod, try disabling them one by one (half by half) until you narrow it down.

unilock commented 2 years ago

Creating and loading a new instance of All of Fabric 5 v1.3.0 worked just fine!? Maybe the problem lied within options.txt - which would be absolutely bizarre, but again, that's technology. Note that I had exported + imported the erroneous instance from an Intel-based Linux computer, which probably had a much more standard keyboard implementation. (ThinkPad P15s Gen 2 running Pop!_OS)

unilock commented 2 years ago

Found the issue!

Setting any key to "Not bound" in the "Key Binds..." options menu results in it being set to key.keyboard.unknown in options.txt. Example:

key_key.advancements:key.keyboard.l -> key_key.advancements:key.keyboard.unknown

GLFW treats the "unknown" key bind as scancode -1, and apparently doesn't like that, throwing the error I was running into.

What key binds have to do with graphics, I have no idea. But I've managed to work around the issue by simply replacing all instances of "unknown" in options.txt with "f12", thus making every "Not bound" key bound to F12. I never use F12 anyway.

I'm not sure whether this is something that can be addressed in ManyMC, but since the issue has been identified and hasn't yet been resolved, I'll reopen it anyway.

EDIT: It doesn't happen on a "vanilla" instance of Minecraft 1.18.2 with Fabric 0.14.8 installed after setting "Jump" to "Not bound", so I'm guessing it's a mod conflict... I'll do some more testing later.

ViRb3 commented 2 years ago

GLFW handles input as well as graphics, so that would make sense. Can you reproduce this issue with vanilla Minecraft? It could be a mod that sets your keybinds to key.keyboard.unknown, or a bug in Fabric/Forge. I don't think ManyMC is at fault here unless you can reproduce on vanilla Minecraft.

unilock commented 2 years ago

No, it's me setting my keybinds to key.keyboard.unknown, by setting the keybinds to "Not bound" within Minecraft. Unless vanilla Minecraft puts something other than unknown in options.txt, and it really is a mod making it as such.

I was unable to reproduce this issue in vanilla Minecraft 1.19, nor 1.18.2, nor Fabric (0.14.8) 1.18.2. So it's almost definitely a mod conflict; I suspect Controlling, but I'm not sure. Although I think that mod has been working fine in my own Fabric 1.19 modpack!?

I was thinking ManyMC would be at fault, since I thought I read it was using its own patched version of GLFW, or LWJGL, or... something. I'm probably wrong though.

I'll be able to test which mod is at fault later. (by repeatedly disabling half the mods, etc.)

ViRb3 commented 2 years ago

Sounds like a mod issue indeed. Closing unless proven otherwise. ManyMC's patches to LWJGL are extremely minimal, and in the case of LWJGL3, there's only one patch and it is unrelated to this.