How to make a shortcut key for "show_only_render"?

Does anyone know how to make a shortcut key for the display properties in the “N” properties window in the 3d view? The items like “show_only_render” and “show_floor” as in the grid floor. I toggle those a lot, but I can not right click on it to change the shortcut, and when I try through the user preferences, I get nothing, even when I try “infrequently used” keyboard keys to assure that those keyboard shortcuts aren’t already used. These display items are not in any header menu either. I would like to toggle display render only with a custom keyboard shortcut. It looks like the command is “show_only_render”.

Please help


I was able to do it by using Ctrl+space (show/hide manipulator) as reference. It’s similar since it’s just on/off and in 3dview.

Add a new keymap under 3dview (global).

In the first line, add wm.context_toggle

In line below, add space_data.show_only_render

then give it a shortcut. That should be it

EDIT: great shortcut. I think I’ll be making more of these :wink:

It works like you a charm. That’s awesome. I use it on just about every Alt+A preview.