Custom pie menu: shift in my hotkeys toggles multiselection mode between vertex edge and faces, how to toggle off previous mode? I work as a professional Alias modeler for the automotive industry, i love Blender but after 8 hours using the same program it always take me some time to switch habits and enjoy modeling on blender.

i'm trying to step into Python to address this issue and the first thing i would like to make is a Pie Menu with similar characteristics.

Alias provide 3 pie menu, 1 for each button of the mouse and the hotkey start with SHIFT + CTRL

Anyway, i've started with a basic pie menu for vertex edge face selection that work with SHFT+CTRL+LMB the problem is when switching between selection modes it keeps the previous mode still on.

Example: Pie menu -> vertex = vertex selection active -> Pie menu -> edge = edge selection active and previous vertex selection still active.

i need a code that toggles the selection mode everytime i choose and keep a single selection mode, any help please?

import bpy
from bpy.types import Menu

# spawn an edit mode selection pie (run while object is in edit mode to get a valid output)


class VIEW3D_MT_PIE_template(Menu):
    # label is displayed at the center of the pie menu.
    bl_label = "Select Mode"

    def draw(self, context):
        layout = self.layout

        pie = layout.menu_pie()
        # operator_enum will just spread all available options
        # for the type enum of the operator on the pie
        pie.operator_enum("mesh.select_mode", "type")


def register():
    bpy.utils.register_class(VIEW3D_MT_PIE_template)

    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name="Mesh")
    kmi= km.keymap_items.new("wm.call_menu_pie", "LEFTMOUSE", "PRESS", shift=True, ctrl=True).properties.name="mesh.mypie"


def unregister():
    bpy.utils.unregister_class(VIEW3D_MT_PIE_template)


if __name__ == "__main__":
    register()

    bpy.ops.wm.call_menu_pie(name="VIEW3D_MT_PIE_template")
import bpy
from bpy.types import Menu

class VIEW3D_MT_PIE_select_mode(Menu):
    bl_label = "Select Mode"

    def draw(self, context):
        layout = self.layout
        pie = layout.menu_pie()
        o = pie.operator("mesh.select_mode", text="Vertex", icon='VERTEXSEL')
        o.type = 'VERT'
        o.use_extend=False
        o.use_expand=False
        o.action='ENABLE'
        o = pie.operator("mesh.select_mode", text="Edge", icon='EDGESEL')
        o.type = 'EDGE' 
        o.use_extend=False
        o.use_expand=False
        o.action='ENABLE'
        o = pie.operator("mesh.select_mode", text="Face", icon='FACESEL')
        o.type = 'FACE'
        o.use_extend=False
        o.use_expand=False
        o.action='ENABLE'
        o = pie.operator("mesh.select_all", text="Select All/None", icon='RESTRICT_SELECT_OFF')
        o.action = 'TOGGLE'

addon_keymaps = []

def registerKeymaps():
    wm = bpy.context.window_manager
    if wm.keyconfigs.addon:
        km = wm.keyconfigs.addon.keymaps.new(name='3D View', space_type='VIEW_3D')
        kmi = km.keymap_items.new('wm.call_menu_pie', 'LEFTMOUSE', 'CLICK_DRAG', shift=True, alt=False,ctrl=False)
        kmi.properties.name="VIEW3D_MT_PIE_select_mode"
        addon_keymaps.append((km, kmi))

def unregisterKeymaps():
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()


def register():
    bpy.utils.register_class(VIEW3D_MT_PIE_select_mode)
    registerKeymaps()

def unregister():
    unregisterKeymaps()
    bpy.utils.unregister_class(VIEW3D_MT_PIE_select_mode)

if __name__ == "__main__":
    register()

    #bpy.ops.wm.call_menu_pie(name="VIEW3D_MT_PIE_select_mode")


This would work. But I strongly recommend not to use this since it will mess things up a lot. Shift + Left Click is used a lot in the keymap and it's not a good idea to replace it. It will make things inconsistent and I think you will likely regret it later if you get used to it doing something else in the viewport. Keys 1, 2 and 3 for mode selection are not that difficult to get used to, you should just suffer for a few days and get over it.