Page MenuHome

New "Click" behavior ruins 3dsmax keymap
Closed, ResolvedPublicTO DO

Description

For a 3dsmax-like keymap it is very important that all objects can be deselected by clicking on empty space. In 2.62 and all previous versions i have done this by using the mouse "Click" event to invoke a "Deselect All" command. This works well because "Click" activates only while the mouse is not hovering over the object. Recently there have been changes in the way the "Click" event works that will cause it to activate regardless of where the mouse is. This ruins the whole 3dsmax-like keymap experience i have been using and trying to replicate for years now.

If you can't revert it to the old behavior, then PLEASE add some sort of flag for the Select all/Deselect operator to check whether the cursor is currently placed above an object. This means for all versions of this operator for every mode- object.select_all, mesh.select_all, pose.select_all etc.

Event Timeline

Just a side-note: a flag in the Select/Deselect All operator is not a very good solution either because it will get triggered more times than necessary and flood the "Last Operator" panel with itself whenever something is selected. Another solution would be a way to toggle the "Click" behavior (old vs. new) through the user-preferences panel.

Please confirm if you verified this with the 2.66 testbuild? I saw this report coming by a month ago or so too...

Yes, i tested it with the 2.66 test build, it's where i discovered this behavior. The last version with the old behavior is 2.64 - this has been introduced somewhere in 2.65 because it's the first official release to do it.

Here is the other report:
http://projects.blender.org/tracker/index.php?func=detail&aid=33724&group_id=9&atid=498

I just could never get a "click outside objects" do deselect to work.
Can you give a .blend startup here with keymap configuration that used to work in 2.62?

Yes, this other report is talking about the same thing!

I am attaching a startup.blend made with 2.64-release because it's the last version where the old behavior works. I am also attaching a .PY file that has the Object Mode keymap changed. Object Mode is used here as an example, but this is true for the Edit, Pose Mode etc.

This was probably an accidental feature to begin with, but it has worked like a charm so far.

I spent 90+ minutes on it, but cannot figure out how this could ever work...

The "Click" mouse event was added to allow "tweaks" - cases when a border-select or tweak-drag or lasso don't get handled. Such tools then have an unhandled release event. In that sense, the release gets converted to 'Click". So the code works fine, because it doesn't (wasn't) meant to register the unhandled select event.

We're just a few days before a release, I will sleep it over a night to see if there's a good new implementation for your (indeed useful) case.

Perhaps there used to be something wrong with the way it differentiated between "tweaks" and normal mouse button presses? In any case - a proper, more elegant solution to "deselect by clicking on empty space" space would be best. Thanks for looking into it!

Sergey suggested to solve this with a tiny python script, to define a new operator called "exclusive select" or so.
That's a 2 line script just combining two operators: deselect-all + select-activate.

That would work satisfying for you (and everyone), without the need for trying to hack the event system for it.

Sergey will test it and commit, i'll post here if that's working.

Checked on such operator. Unfortunately, it's not so easy -- View3D.select is only implements invoke(), meaning it couldn't be called from a script.

However, found a wirkwround which i've commited for Maya preset. Basically it works now this way:

- Border select is using TWEAK, for which you need to hold LMB down and move mouse. This prevents operators using RELEASE/CLICK events from being fired.
- LMB select is using RELEASE event, this is no selection happens before border if you do border select. And this prevents any operator uses CLICK event from being fired.
- Delect all happens by CLICK, which would be fired only in case no operators were handled with PRESS/RELEASE.

So, Maya preset shall work for you now. If you've got own keymap you want to make behave the same way, you shall use RELEASE for view3d.select and CLICK for deselect_all.

Not so much straightforward and maybe Ton would like to rethink all this CLICK/DBL_CLICK/RELEASE/etc events for 2.67.

Hmm, it's a workaround but it does work well. With the release of 2.66 being so near, this solution will do for now, but as Sergey mentions, it's better to have this implemented in a more straight-forward fashion for 2.67.

Since it's long overdue, i will use this workaround to update my "3dsmax" keymap to be (i hope) officially included in 2.67 as well.

Well, i do not consider this a workaround. This is actually much more clear than the same shortcut for different actions in which behavior is not so much well defined.

I consider it a workaround because it requires you to make a compromise with the way regular selection works - on release rather than on press. Even if that is not important (perhaps better in some cases), versions prior to 2.65 didn't need that and worked equally well with both "Press" and "Release". So what has changed?

I've marked this as todo item in our wiki here:
http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/UserInterface#Events

For 2.67 I'll study on cleanup of the code here. I think our 'tweak' system needs recode to make event handlers behave more predictably.

Ton Roosendaal (ton) changed the task status from Unknown Status to Unknown Status.Feb 14 2013, 2:11 PM

Just noticed an annoying by-product of this "select on release" workaround. When using the manipulator arrows you hold down the mouse button. If you are doing this and decide to cancel by pressing Esc, releasing the mouse will select anything that is currently under it. This became very noticeable when posing an armature because you have many bones that are bunched in the same place.

Well, it's been 4 years and this is still on the ToDo. Perhaps it's time to take another look at this click/doubleclick/passthrough issue for 2.8?

Nik Prodanov (nikprodanov) changed the task status from Unknown Status to Unknown Status.Apr 21 2017, 10:13 PM
Julian Eisel (Severin) closed this task as Resolved.Aug 3 2020, 2:02 PM
Julian Eisel (Severin) claimed this task.

This is an old report. There's no official 3ds Max keyboard layout anymore and the behavior to deselect when clicking on empty space is default now.
Time to close this for good I guess :)