How to add shortcut for 'Only Render'?
In ⎈ Ctrl⎇ AltU&gt; User preferences &gt; Input, navigate to 3D view &gt; 3D view (Global), then scroll to the bottom of 3D view &gt; (Global) and click add new.

Put wm.context_toggle as the operator.
This is an operator which toggles a property given by a datapath parameter.

Put space_data.show_only_render as the datapath parameter (you can put stuff there even if it appears grayed out). You can get the datapath for any checkbox by right clicking on it and selecting Copy Data Path. The datapath can then be pasted with ⎈ CtrlV.

Assign a key combination which doesn't conflict with an existing shortcut (e.g. ⇧ ShiftQ)



Now pressing ⇧ ShiftQ (or whatever you assigned as the shortcut) in the 3D view will toggle show only render.