-
Notifications
You must be signed in to change notification settings - Fork 0
/
keymap.py
29 lines (20 loc) · 895 Bytes
/
keymap.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import bpy
from .bl_operator.ops_notes import EST_OT_edit_note
from .bl_operator.ops_gp_modal import EST_OT_gp_view
addon_keymaps = []
def register():
wm = bpy.context.window_manager
if not wm.keyconfigs.addon: return
km = wm.keyconfigs.addon.keymaps.new(name='Node Editor', space_type='NODE_EDITOR')
kmi = km.keymap_items.new(EST_OT_edit_note.bl_idname, 'LEFTMOUSE', 'DOUBLE_CLICK', ctrl=False, shift=False)
addon_keymaps.append((km, kmi))
km = wm.keyconfigs.addon.keymaps.new(name='Node Editor', space_type='NODE_EDITOR')
kmi = km.keymap_items.new(EST_OT_gp_view.bl_idname, 'MOUSEMOVE', 'ANY', ctrl=False, shift=False)
addon_keymaps.append((km, kmi))
def unregister():
wm = bpy.context.window_manager
kc = wm.keyconfigs.addon
if not kc: return
for km, kmi in addon_keymaps:
km.keymap_items.remove(kmi)
addon_keymaps.clear()