Hello friends,
I can read keymap items from the windows manager. This code retreives the keys in the 3D View, Object Mode section for example:
wm = context.window_manager # Blender window manager
keymaps_3DV = wm.keyconfigs.active.keymaps['Object Mode']
But this reads just the entries from the old tool system. The new tool system for the tool shelf are not to retrieve this way. They are not in the tuple.
What is the way to access this new builtin keys? Is this even possible?
Kind regards
Arunderan
Example script to test. Open the hello world panel to write the tuple content into the console:
import bpy
class PT_PT_PT_HelloWorldPanel(bpy.types.Panel):
"""Creates a Panel in the Object properties window"""
bl_label = "Hello World Panel"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = "View"
def draw(self, context):
layout = self.layout
row = layout.row()
row.label(text="Hello world!", icon='WORLD')
wm = context.window_manager # Blender window manager
keymaps_3DV = wm.keyconfigs.active.keymaps['Object Mode']
print(tuple(keymaps_3DV.keymap_items.keys()))
def register():
bpy.utils.register_class(PT_PT_PT_HelloWorldPanel)
def unregister():
bpy.utils.unregister_class(PT_PT_PT_HelloWorldPanel)
if __name__ == "__main__":
register()