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

Fix #12544, arrow keys selecting objects in scene hierarchy #12795

Closed

Conversation

TheSofox
Copy link
Contributor

Fix for #12544, allowing objects to be automatically selected in the scene hierarchy when navigating with arrow keys through the scene tree.

…ted in the scene hierarchy when navigating with arrow keys through the scene tree.
@Paulb23
Copy link
Member

Paulb23 commented Nov 10, 2017

This will make multi-selecting in tree's by keyboard impossible. By default in SELECT_MULTI mode you navigate with the arrow keys and press space to select/unselect items.

@TheSofox
Copy link
Contributor Author

SELECT_MULTI doesn't seem to work anyway with 2D Nodes or anything descended from CanvasItem that brings up the 2D screen. Try to multi select in a 2D scene using the keyboard and you'll find you can't. This bug fix makes the 2D node behaviour consistent with the 3D mode behaviour.

More to the point, the bug exists because having keyboard multi select by default is counterintuitive for new users. Such can be seen when you watch the video attached to the original bug report.

Having said that, I admit that keyboard multi-selecting is disabled by this bug fix. Could you give a better idea of how much this function is used? Maybe there's a way both styles could be accommodated.

@Paulb23
Copy link
Member

Paulb23 commented Nov 10, 2017

If you place a tree in a scene set the selection mode to SELECT_MULTI it acts like the 3D SceneTree, so somewhere is making the 2D SceneTree act against the defaults.

But I agree that when navigating the SceneTree it should be consistent and select nodes by default. The problem is SELECT_MULTI is also used by the mouse allowing Shift and Control clicking.

An idea might be to move the more advanced behaviour behind Ctrl so:

Ctrl+Up / down / left / right - will move and not select items.
Ctrl+Space - Select/Unselect items

This could then allow eventual support for Shift selection.

@TheSofox
Copy link
Contributor Author

I've been looking around and don't know how to change the SELECT_MULTI variable from within the GUI.

In any event, my code changes strictly deal only with keyboard ARROW key input. Multiple item selecting with Ctrl+mouse and Shift+mouse work perfectly well. And moving with Ctrl+Arrow Key works fine too.

So really, the question boils down to this: If you select multiple items, and press an Arrow key, should the items stay selected, only one item be selected, that item being the next one down from the last selected object?

I argue that it should. For one, this is exactly how Windows Explorer interface works: Select multiple file icons, press an arrow key, and it'll go back to only one item being selected. It's what users expect.

Second, I believe this is how Unity works, another thing people expect.

Thirdly, so far we've got a YouTube video by a game developer arguing in favour of it and an actual bug report filed to support this behaviour.

Honestly, the key question is "What will make the Godot interface more user friendly, especially to newbies who will be checking it out once 3.0 hits?" I believe that this fix supports that aim.

@Paulb23
Copy link
Member

Paulb23 commented Nov 12, 2017

You currently have to do it though GDScript with the following:

extends Tree

func _ready():
	set_select_mode(SELECT_MULTI)

Ahh just tested Ctrl+Arrow Keys move the children around so we can't use that shortcut - well we could change it to use Alt or place the keyboard multi-select behind Alt.

I agree with the rest.

@reduz
Copy link
Member

reduz commented Nov 13, 2017

This seems like a pretty bad hack, and current behavior is fine.

@reduz reduz closed this Nov 13, 2017
@reduz
Copy link
Member

reduz commented Nov 13, 2017

what could change is by default calling select_single_item unless shift is pressed, though.

@reduz
Copy link
Member

reduz commented Nov 13, 2017

or maybe space is multi select and return is select single.

@TheSofox
Copy link
Contributor Author

If "current behavior is fine" why was bug #12544 filed in the first place?

@akien-mga
Copy link
Member

I don't think the current behaviour is fine, what's shown on that video is quite unintuitive. Let's look for a better fix.

@akien-mga akien-mga reopened this Nov 13, 2017
@samvila
Copy link
Contributor

samvila commented Nov 14, 2017

Thank you @akien-mga for re-opening this issue. I think new users will find this very useful and also regular users will find this way more convenient. It's important to have a low frustration level when using a software as it was showed on the youtube video.

@TheSofox
Copy link
Contributor Author

TheSofox commented Dec 6, 2017

I'm glad this issue has been reopened, thank you.

So should this pull request be accepted?

@akien-mga
Copy link
Member

Thanks a lot for your contribution!
We are now entering a strict release freeze for Godot 3.0 and will only consider major bug fixes. We won't merge new features and enhancements anymore until 3.0 is released.

Moving this PR to the 3.1 milestone, to be reviewed once the release freeze is lifted. It could eventually be cherry-picked for a future 3.0.1 maintenance release if it doesn't change the user-facing APIs and doesn't compromise the engine's stability.

@akien-mga
Copy link
Member

(And sorry for the delay on this PR, there are a lot of PRs to handle daily and the status on this one so far is that @reduz is not happy with the proposed fix, even though we agree that there is an issue to fix - so more work will be needed).

@akien-mga akien-mga modified the milestones: 3.0, 3.1 Jan 4, 2018
@akien-mga
Copy link
Member

Superseded by #16947.

@samvila
Copy link
Contributor

samvila commented Oct 3, 2018

Please re-open the report, keys are still not working on a 3D project, for example if you create a bunch of meshinstances and try to use the arrow keys you will find that the meshes are not being selected on the viewport.

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.

5 participants