MidnightControls

MidnightControls

447k Downloads

Breaking key binding bug

Pointlesstrfx opened this issue ยท 5 comments

commented

Describe the bug
First none of the binds I put in saved. Second and worst is that the last key bind you input in is stuck on and keeps inputting, making the the controller unresponsive.

To Reproduce
Steps to reproduce the behavior:

  1. Go into controller bindings
  2. Change any key bind
  3. try using any buttons or inputs
  4. See error; inputs additional key binds and unable to exit

Expected behavior
That inputting the intended key bind and exiting the input means it no longer accepts additional inputs.

Screenshots

Screenshot 2023-10-20 211124

Desktop (please complete the following information):

  • OS: Windows 11
  • Minecraft 1.20.2
  • Fabric 0.90.0+1.20.2
  • Mods 3dskinlayers-fabric-1.5.6-mc1.20.2, AmbientSounds_FABRIC_v5.2.23_mc1.20.2, CreativeCore_FABRIC_v2.11.2_mc1.20.2,
    Do-a-barrel-roll-3.3.5+1.20-fabric, Fabric-api-0.90.0+1.20.2, Fabric-language-kotlin-1.10.10+kotlin.1.9.10, Iris-mc1.20.2-1.6.10,
    Lithium-fabric-mc1.20.2-0.12.0, Midnightcontrols-1.9.0+1.20.2, Modmenu-8.0.0, Shulkerboxtooltip-fabric-4.0.5+1.20.2,
    Sodium-fabric-mc1.20.2-0.5.3, Timedisplay-1.4.0, Voicechat-fabric-1.20.2-2.4.27, Yet-another-config-lib-fabric-3.2.1+1.20.2.
  • Version 1.9.0+1.20.2
  • Branch

Additional context
It works perfectly fine in 1.20, I don't know how it broke so badly now.

commented

I am having this same problem.
The keybinds in the config file do not appear to be properly saving:

"BINDING": {
    "controller.controls.forward": "101",
    "controller.controls.debug_screen": "-1",
    "controller.controls.pick_block": "14",
    "controller.controls.screenshot": "-1",
    "controller.controls.controls_ring": "-1",
    "controller.controls.chat": "-1",
    "controller.controls.key.command": "-1",
    "controller.controls.key.modmenu.open_menu": "-1",
    "controller.controls.key.boosted-brightness.select2": "-1",
    "controller.controls.key.boosted-brightness.next": "-1",
    "controller.controls.key.boosted-brightness.lower": "-1",
    "controller.controls.player_list": "-1",
    "controller.controls.key.keyboard.apostrophe": "-1"
  },

This could be one possible cause but further digging is required

commented

Ok so I think the problem might be caused by this line not getting called:

If this line does not get calls then I think it will keep adding buttons into the controlsInput.currentButtons list

Unrelated, but why is it converting it into an array and passing it into finishBindingEdit when the array is just a carbon copy of currentButtons which is accessible in ControllerControlsWidget. I don't think that's what's causing the issue but it was the only thing that looked odd to me.

I can't figure it out from the code alone I'd need a debugger

commented

This is actually caused by the trigger buttons outputting a negative state when idle, which results in them being set as REPEAT in the "handleAxe" method and therefore not allowing the code @Techcraft7 mentioned to be executed. Thank you very much for your help!

commented

For some reason, this causes the left click keybind to assume it's always in touch mode when it shouldn't be.

commented

Fixed in 1.9.1 and higher