I try to make a script that render a shortcut chart in blender, but i cannot get a correct shortcut from keymap_items.
Where to find it?
import bpy
km = bpy.context.window_manager.keyconfigs.default.keymaps["3D View Tool: Move"]
print(km.name)
for i in km.keymap_items:
print(i.name, i.ctrl, i.shift, i.alt, i.value, i.type)
I mean the key for “Move” as example,
i guessed keymap_items.value should give me the key to press, i expected “g”.
But it gives ANY. How i get the desired keystroke?
No, the .type attribute stores the key that is assigned. The .value attribute stores whether an event is triggered on PRESS or RELEASE. I think ANY means the event is triggered by both a key press and a key release.
For a different keymap example using Blender’s python console: