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

Add Ctrl + L / Cmd + Shift + G shortcut to focus path bar in FileDialog #81177

Merged

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Aug 30, 2023

This also tweaks EditorFileDialog to use the same shortcut, while making it select the path text after focusing (like in most file managers).

Ctrl + L / Cmd + Shift + G can also now be used to focus on the property name in the project settings editor, as well in the Input Map, Autoload, Shader Globals and Global Groups tabs.

Testing project: test_filedialog_focus_shortcut.zip

@bruvzg
Copy link
Member

bruvzg commented Aug 30, 2023

Is this the correct shortcut to use on macOS?

I guess it's the closest thing, there's no path bar in the native file dialog, and Go to shortcut works the same way as in Finder.

@ryevdokimov
Copy link
Contributor

Works on Windows.

Don't see why it wouldn't work on macOS based on the code, and comment above.

2024-01-15.10-15-20.mp4

@passivestar
Copy link
Contributor

@Calinou Works on mac, but if the focus is inside of the window it also selects the folder that starts with g:

Screen.Recording.2024-01-15.at.19.27.41.mp4

@passivestar
Copy link
Contributor

@Calinou

Is this the correct shortcut to use on macOS?

It is the correct shortcut in Finder, but I'm not sure if a lot of people know it exists. I keep forgetting that shortcut and I've been using macs on and off for over a decade 🙂

I recommend using Cmd+L instead (or at least in addition to Cmd + Shift + G) because that's what all of the web browsers are using, including the native Safari

@Calinou
Copy link
Member Author

Calinou commented Jan 15, 2024

@Calinou Works on mac, but if the focus is inside of the window it also selects the folder that starts with g:

It's strange this happens, as the code specifically marks the input as handled by calling set_input_as_handled() just after.

@Calinou Calinou force-pushed the filedialog-focus-path-shortcut branch from b9307ed to a9cc583 Compare January 15, 2024 17:16
@Calinou Calinou requested a review from a team as a code owner January 15, 2024 17:16
@Calinou
Copy link
Member Author

Calinou commented Jan 15, 2024

I've added Cmd + L on macOS in addition to the existing Cmd + Shift + G there.

Ctrl + L / Cmd + Shift + G can also now be used to focus on the property name in the project settings editor (or the "add input" box in the input action editor).

@Calinou Calinou force-pushed the filedialog-focus-path-shortcut branch from a9cc583 to d0e70d4 Compare January 15, 2024 17:21
@ryevdokimov
Copy link
Contributor

I've added Cmd + L on macOS in addition to the existing Cmd + Shift + G there.

Ctrl + L / Cmd + Shift + G can also now be used to focus on the property name in the project settings editor (or the "add input" box in the input action editor).

"Add input box", this?

image

@Calinou
Copy link
Member Author

Calinou commented Jan 15, 2024

"Add input box", this?

Yes 🙂 I thought about focusing Filter by event instead, but am not sure how often you'd need to focus on that box in comparison (while quickly focusing on Add New Action can be very useful to add many inputs at once).

@ryevdokimov
Copy link
Contributor

I got everything to work except that, it doesn't seem to focus anything.

@passivestar
Copy link
Contributor

Everything works on my end, including the "Add New Action"

@ryevdokimov
Copy link
Contributor

Ah weird, I rebuilt and it's working on my end too. My bad.

@KoBeWi

This comment was marked as resolved.

Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine. As commented in project settings editor, more tabs could use the shortcut.

@akien-mga akien-mga modified the milestones: 4.x, 4.3 Mar 2, 2024
This also tweaks EditorFileDialog to use the same shortcut,
while making it select the path text after focusing
(like in most file managers).

Ctrl + L / Cmd + Shift + G can also now be used to focus on the
property name in the project settings editor, as well in the
Input Map, Autoload, Shader Globals and Global Groups tabs.
@Calinou Calinou force-pushed the filedialog-focus-path-shortcut branch from d0e70d4 to 4f8d7ca Compare March 4, 2024 23:03
@Calinou Calinou requested a review from a team as a code owner March 4, 2024 23:03
@Calinou Calinou requested a review from a team as a code owner March 4, 2024 23:03
@Calinou
Copy link
Member Author

Calinou commented Mar 4, 2024

Seems fine. As commented in project settings editor, more tabs could use the shortcut.

Done (see the updated PR description for details).

@akien-mga akien-mga merged commit 9e13b90 into godotengine:master Mar 5, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@Calinou Calinou deleted the filedialog-focus-path-shortcut branch March 5, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants