Code to toggle viewport display material alpha
You would have to implement an Operator for a shortcut. I'd suggest ask for the alpha value and set it based on a certain condition. Following example is based on our famous operator_simple.py template that comes with Blender (Text Editor &gt; Templates &gt; Python &gt; Operator Simple):
class SimpleOperator(bpy.types.Operator):
    &quot;&quot;&quot;Tooltip&quot;&quot;&quot;
    bl_idname = &quot;object.simple_operator&quot;
    bl_label = &quot;Simple Object Operator&quot;

    @classmethod
    def poll(cls, context):
        return context.active_object.active_material is not None

    def execute(self, context):
        # Get viewport display color
        diff_clr = context.object.active_material.diffuse_color
        # Get the alpha component and set it
        if diff_clr[3] == 1.0:
            diff_clr[3] = 0.2
        else:
            diff_clr[3] = 1.0
        
        return {'FINISHED'}

How to implement the shortcut: Create keyboard shortcut for an operator using python?