TheDuriel / MagicMacros

Godot Addon for enhanced autocomplete and code snippets
MIT License
52 stars 4 forks source link

Does not seem to work if the script editor is detached #3

Closed Bimbam360 closed 1 month ago

Bimbam360 commented 1 month ago

As the title implies.

This is partially due to the detached script editor seemingly being _unhandled_input rather than _input, however something else is afoot.

TheDuriel commented 1 month ago

I don't use Godot in multi window mode due to latency issues with menus, so this slipped by.

Can you confirm whether or not you get the green highlight indicating that a macro was detected?

If so, I think it'll just be a matter of forwarding _input from the window, which I should be able to do!

TheDuriel commented 1 month ago

Interestingly, the potential fix causes some issues. I've put it on the development branch for now.

But essentially, there is no easy way to intercept an input event in a secondary window, so that it does not reach the script editor.

It would require detecting the presence of the window, adding a node to it, and for that node to intercept the event. I don't see a way to easily get a hold of the window though, until it is too late.


The only solution I see is to, every frame, check if the script editor window is the main editor window. >.<

TheDuriel commented 1 month ago

Closing as solved! (untested, but should work!)