# How to detect clicks on empty space via python?

To elaborate - I want a setup where LMB clicking (in the LMB to select setup) on an empty space in the 3D View causes all of the mesh to be deselected when in Edit Mode, all objects when in Object mode, etc. I specifically would like to do it via an addon, but any help is appreciated.

• I'm not sure what you want.. Do you just want to deselected everything (in python)? – gandalf3 Jul 24 '14 at 18:45
• I edited the question with a clearer explanation. – PLyczkowski Jul 24 '14 at 18:50

It's actually really simple:

• Go to User Preferences > Input and change the filter type from Name to Key-Binding
• Search for action and find the 3D View category
• Change view3d.cursor3d to object.select_all
• Set Action to Deselect

• Clear search filter
• Expand 3D View > Mesh and Add New
• Set it to mesh.select_all and Deselect
• Bind it to Mouse, Action and Press
• Sorry, I messed up. I meant Select mouse (I think is the term). So - LMB clicking on empty space in the LMB to select setup, or RMB in the RMB to select. – PLyczkowski Jul 25 '14 at 16:11
• I see, my bad! You can still make it work: bind the select_all operation to double-click so it doesn't interfere with LMB select click! – CodeManX Jul 25 '14 at 17:27