Skip to content

Conversation

@Elliesaur
Copy link
Contributor

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.

  • Completely custom setting screen for Keybinds, allowing a user to add/remove their own keybinds and associate them with actions which are tied in with the InputMap singleton in Godot.
  • Default example action is implemented as "ping", the implementation is found in the Keybinds.gd file.
  • A custom prefix for keybind actions to set them apart from other InputMap actions, I find it difficult to properly reload without this as I do not want to accidentally in the future remove all InputMap actions! The prefix is advertised to other mods using global mod messages and a global mod data dictionary.
  • Keybinds for Model Toggles #112 has been implemented in this as an example.

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.

@ExpiredPopsicle
Copy link
Owner

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.

@copygirl
Copy link
Contributor

copygirl commented May 21, 2025

What would be the benefit of using the global mod messaging system over Godot's existing (more versatile) input functions?

@Elliesaur
Copy link
Contributor Author

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.

With regards to this, are you referring to not using InputMap and instead an internal representation inside the mod itself?

@Elliesaur
Copy link
Contributor Author

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...

@Elliesaur
Copy link
Contributor Author

Happy to take comments on this PR and improve it to suit the needs of the project going forward.

@ExpiredPopsicle
Copy link
Owner

I'll take another look at it this week. Sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants