Controlling

Controlling

236M Downloads

Compatibility issues with Modern Keybindings and No More Useless Keys, Fabric 1.20.x

Gamemassa opened this issue ยท 11 comments

commented

I'm noticing that in Fabric 1.20.x both No More Useless Keys (NMUK) and Modern Keybindings work with each other but don't function correctly when Controlling is also installed, and I wasn't sure which end the incompatibility was coming from so I posted in all three GitHub pages.

commented

Thanks so much guys! And @jaredlll08 , sorry if I caused any miscommunication up there yesterday.

commented

Update - The Modern Keybindings team said they're working on an update for their mod that will add compatibility with Controlling. Still haven't heard back from the NMUK team.

commented

I'm happy to add stuff to controlling (api related stuff) if it would make it easier for them

commented

Oh cool. I'll let them know.

commented

I'm happy to add stuff to controlling (api related stuff) if it would make it easier for them

Sounds like Mikhail (the Modern Keybindings developer) is thrilled about that. Still haven't heard from the NMUK guys yet (but might not hurt to go ahead with that anyway).

commented

Hello!
In the newly released mkb-1.20.x-1.2.0, I implemented your IPlatformHelper in committee.nova.mkb.platform.MKBPlatformHelper.
Also tested to be working when the class name was defined in the provider configuration file.

commented

uh, you should NOT be doing that, my IPlatformHelper is purely for internal usage to make Multiloader code possible, no mods should be implementing it as it will simply load the first service it finds and ignore the rest.

When I said I am happy to add stuff api wise, I meant events that you could listen to.

Please remove that code as I cannot guarantee that it will always work and I cannot guarantee that your service will always be loaded, I will be looking into how to lock my services down to ensure that only my service class is loaded.

commented

uh, you should NOT be doing that, my IPlatformHelper is purely for internal usage to make Multiloader code possible, no mods should be implementing it as it will simply load the first service it finds and ignore the rest.

When I said I am happy to add stuff api wise, I meant events that you could listen to.

Please remove that code as I cannot guarantee that it will always work and I cannot guarantee that your service will always be loaded, I will be looking into how to lock my services down to ensure that only my service class is loaded.

Got it thx. Is there any more recommended solution for this situation?

commented

With the latest version of Controlling, you can do the following:

ControllingEvents.HAS_CONFLICTING_MODIFIERS_EVENT.register(event -> {
    return ((IKeyBinding)event.thisMapping()).hasKeyCodeModifierConflict(event.otherMapping());
});

ControllingEvents.SET_KEY_EVENT.register(event -> {
    ((IKeyBinding) event.mapping()).setKeyModifierAndCode(KeyModifier.getActiveModifier(), event.key());
    return false; // return false since we want the default behaviour to run as well
});

ControllingEvents.IS_KEY_CODE_MODIFIER_EVENT.register(event -> {
    return KeyModifier.isKeyCodeModifier(event.key());
});

ControllingEvents.SET_TO_DEFAULT_EVENT.register(event -> {
    ((IKeyBinding) event.mapping()).setToDefault();
    return false; // return false since we want the default behaviour to run as well
});

That should replace everything your platform helper did.

Let me know if you run into any issues / need anything else.

commented

Can be sure ModernKeyBinding 1.2.0 is compatible with the latest 12.0.2 Controlling now. Thank u!

commented

@jaredlll08 Still haven't heard back from the No More Useless Keys team, but I'll keep trying.