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

Auto-complete prompt closes if a modifier button is pressed when using custom navigation keys #50064

Closed
djpeach opened this issue Jul 2, 2021 · 3 comments

Comments

@djpeach
Copy link

djpeach commented Jul 2, 2021

Godot version

3.3

System information

MacOS BigSur 11.4

Issue description

The autocomplete prompt in the editor closes if I press a modifier button. This is an issue for me because I bound Cmd+H,J,K,L to their vim equivalents (left, down, up, right). In every other editor I use, I can type to start autocomplete, then use Cmd+.. to navigate the autocomplete dialog that pops up. I can't do this in godot bc of (I think) this line. I am not sure why the allow_unicode_handling boolean matters when determining of code completion should cancel, but it will definitely be false since the boolean is

/* Allow unicode handling if:              */
	/* No Modifiers are pressed (except shift) */
	bool allow_unicode_handling = !(k->is_command_pressed() || k->is_ctrl_pressed() || k->is_alt_pressed() || k->is_meta_pressed());

This will most certainly be false, bc the meta key is pressed when I used Cmd. I have compiled locally and removed the line linked above and all works well, so I am not sure what it is for. I am hoping @Paulb23 who wrote this code will know if this is something that can be addressed, or if I am way off base here. Thanks!

Steps to reproduce

Open any project (pref on Mac), start typing to get auto-complete, and then hit and hold the Cmd button. The auto-complete fails.

Minimal reproduction project

No response

@timothyqiu
Copy link
Member

FYI: allow_unicode_handling was actually introduced by #43663.

@EricEzaM
Copy link
Contributor

EricEzaM commented Jul 2, 2021

You are experiencing the bug on the 3.3 version, but are looking at code for 4.0 (current master). I cannot reproduce the issue on current master - triggering autocomplete and then pressing control does not close the autocomplete. I am on WIndows but I don't think it matters.

allow_unicode_handling matters because we don't want to insert text when the user is pressing a shortcut, like Ctrl+A to select all. This matters for code completion, because you can type text while the autocomplete window is showing, and it will update the results.

@Calinou Calinou changed the title Auto-complete prompt closes if a modifier button is pressed Auto-complete prompt closes if a modifier button is pressed when using custom navigation keys Jul 2, 2021
@djpeach djpeach closed this as completed Jul 5, 2021
@djpeach
Copy link
Author

djpeach commented Jul 5, 2021

Yep, seems sticking with 4.0 will solve this issue.

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

4 participants