Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify input action in Project Settings #19

Open
klootas opened this issue Sep 25, 2023 · 2 comments
Open

Specify input action in Project Settings #19

klootas opened this issue Sep 25, 2023 · 2 comments

Comments

@klootas
Copy link

klootas commented Sep 25, 2023

Great plugin!
A suggestion for an improvement would be to be able to specify the name of the action used to toggle the visibility in Godot's Project Settings window. Much like this plugin does:
https://github-production-user-asset-6210df.s3.amazonaws.com/11432672/269932201-ca604382-569f-4367-ba9a-457aaf1d2a6a.png

@Calinou
Copy link
Member

Calinou commented Sep 25, 2023

I'm not sure if changing the action's name from the project settings makes sense – it's also prone to typos.

Instead, you should create an action called cycle_debug_menu in the Input Map tab. This isn't done manually due to an editor bug that makes it not refresh automatically if I create it from a @tool script, so it's done at runtime instead:

if not InputMap.has_action("cycle_debug_menu"):
# Create default input action if no user-defined override exists.
# We can't do it in the editor plugin's activation code as it doesn't seem to work there.
InputMap.add_action("cycle_debug_menu")
var event := InputEventKey.new()
event.keycode = KEY_F3
InputMap.action_add_event("cycle_debug_menu", event)

This needs godotengine/godot#25865 to be fixed first.

@klootas
Copy link
Author

klootas commented Sep 25, 2023

Ah, I see. While I think it would be nice to specify the name of the input action, the important thing is that we can specify the actual bindings for input 👍

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

No branches or pull requests

2 participants