# Add custom shortcut to toggle “Maximum Draw Type”

I´m trying to add custom shortcut "E" in Object mode to toggle between Maximum Draw Types (wire, solid, textured, bounds) for selected object, but my attempts were not successful. I read some similar topics from this forum, but unfortunately I do not understand enough to be able to solve it myself.

You can define shortcut for list of properties as there are 4 of them in the dropdown list you want shortcut for.

To do that you need to create new shortcut, in this case in 3D View (Global) section so it's accessible in the viewport in all available modes.

Then, instead of "none" in the operator field write there wm.context_menu_enum. This will mean that you are transferring enumeration to the operator. You can steal this setup from any default Blender command, e.g. Snap Element menu which is called via Ctrl+Shift+Tab. You will see there how and where is written command shown above.

Once you confirmed, there will appear 2 fields - RNA and Context Attributes. The last one is what is needed, put there command for the dropdown list, you can get it hovering your mouse over it in Blender interface > Properties editor > Object tab > Display rollout > Maximum Draw Type. The Python command is object.draw_type.
Final settings are shown in the screenshot below.

After setting up desired shortcut (Alt+E used in the gif below) you will get dropdown list appearing below your mouse in the viewport. To make it work on several objects do the same as in other cases of changing one property for multiple objects - press Alt before pressing element in the list.

It will change the property for only one object if Alt isn't pressed.

• Well, I was pretty close to the solution, but I made a mistake somewhere. But now, I understand how it works much better, thanks a lot – Miroslav Halfar Jan 19 '18 at 14:42