So I’m using one of those standard keymap PY templates to add my own custom hotkeys, where the standard chain for adding a new key looks something like this:
wm = bpy.context.window_manager kc = wm.keyconfigs.addon km = kc.keymaps.new('Screen Editing', space_type='EMPTY', region_type='WINDOW', modal=False) kmi = km.keymap_items.new("screen.area_options", 'LEFTMOUSE', 'PRESS')
Now, pretend that instead of adding a hotkey that way, I wanted to remove one of Blender’s default hotkey assignments for a given op. (Don’t worry about reassigning a hotkey to the op.) I’ve been Googling how to do this, but I’m not sure I have the exact chain right. Let’s pretend I want to remove Blender’s default/existing hotkey for the same op as above (Screen Editing -> screen.area_options). How would I do that?
I’ve gotten as far as figuring out that maybe this is the remove command:
But I’m not sure how to fill in the questions marks. And there might also be an "active’ property that you can disable instead?
bpy.context.window_manager.keyconfigs.default.keymaps['Screen Editing'].keymap_items[???].active = False