Add keybind functionality - #120
Conversation
- Still lots to do/rework.
Woooops
|
Hey I finally got to looking at this. Could it be adjusted so that the keybinds mod handles the input and then sends out events via the global mod messaging system, instead of the individual mods having to handle the input events? Trying to minimize the API footprint for the mods still. Appreciate the contribution. Sorry it's taken so long to get to looking at it. |
|
What would be the benefit of using the global mod messaging system over Godot's existing (more versatile) input functions? |
With regards to this, are you referring to not using InputMap and instead an internal representation inside the mod itself? |
|
As per recent discussion (stream) this feature will be reworked and internally handle the input events, sending via the global mod messaging system. Stay tuned... |
|
Happy to take comments on this PR and improve it to suit the needs of the project going forward. |
|
I'll take another look at it this week. Sorry for the delay. |
|
Have you had issues with keybinds not registering after you close and reopen SnekStudio? I'm looking into using keybinds to activate VRM expression toggles (as a separate mod) and this has been bugging me. I made a mod called Expressions which listens for the keybind mod messages. Then I made a keybind called "surprised" bound to Alt+F5. If I use the keybind right after making it, the global mod message is sent and properly received by other mods. But if I close and restart the program, even though the keybinds are loaded from the settings, the mod messages aren't sent. |
This PR adds support for users to create custom keybinds for actions that are used by other mods.
This is a rather complex enhancement and I do admit that there might be a bit of contention on how best to work with keybinds in such programs.
I look forward to constructive feedback on what should be worked in and what should be left to other mod developers.
P.S. I also came across an interesting issue that was known given the popular use of the "Resources" folder in other mods. I wonder if we should address this in another issue and instead of picking the first .tscn file as the "mod", look at which extends Mod_Base. Not sure how this works in Godot but might be something else I can explore.