Created
January 31, 2021 20:10
-
-
Save tin2tin/bbc742d69689ae82df6af3f2455b1ca1 to your computer and use it in GitHub Desktop.
Copy keymap: https://blender.stackexchange.com/questions/90248/is-there-a-way-to-create-a-copy-of-the-default-keymap-configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
wm = bpy.context.window_manager | |
CopiedMap = wm.keyconfigs.new("CopiedMap") | |
#Get list of default keymap items | |
keymaps = wm.keyconfigs.default.keymaps.items() | |
for i in keymaps: | |
#Put default values in to new keymaps | |
CopiedMap.keymaps.new(i[1].name, space_type= i[1].space_type, | |
region_type=i[1].region_type) | |
#Get list of default keymap_items contained | |
#within the keymap | |
keymap_items = i[1].keymap_items.items() | |
for j in keymap_items: | |
#Put values in to new keymap_items | |
CopiedMap.keymaps[i[1].name].keymap_items.new(j[1].idname, j[1].type, j[1].value, any=j[1].any, | |
shift=j[1].shift, ctrl=j[1].ctrl, alt=j[1].alt, | |
oskey=j[1].oskey, key_modifier=j[1].key_modifier) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment