I want to write an addon, which enables you to switch quickly, via a pie menu, between the editor types. (e.g. Node Editor, 3D View, Graph Editor, etc...) To get my shortcut working, I need to register the same keymap for every space or editor type.
keymap_items.new("wm.call_menu_pie", type = "E",alt=True, value = "PRESS"))
Right now I got it working with only one editor type:
keyconfigs.addon.keymaps.new(name = "Node Editor", space_type = "NODE_EDITOR")
I know, I could simply register my keymap for every single editor type with a loop, but I am sure there is a more convenient and beatiful way to accomplish my objective.
( Maybe something like
space_type = "WINDOW"?)
PS: My current registration code looks like this:
addon_keymaps =  def register_keymaps(): global addon_keymaps wm = bpy.context.window_manager km = wm.keyconfigs.addon.keymaps.new(name = "Node Editor", space_type = "NODE_EDITOR") kmi = km.keymap_items.new("wm.call_menu_pie", type = "E",alt=True, value = "PRESS") kmi.properties.name = "view3d.switcher" addon_keymaps.append(km)