Fix: Lasso select for Grease Pencil doesn't work in the Nodes Editor
authorJoshua Leung <aligorith@gmail.com>
Sun, 8 May 2016 14:44:21 +0000 (02:44 +1200)
committerJoshua Leung <aligorith@gmail.com>
Sun, 8 May 2016 14:44:21 +0000 (02:44 +1200)
In the nodes editor, Ctrl-LMB-drag is taken by "Cut", and it seems impossible
for any other keymap to override that. Instead, the default lasso select hotkey
there is Ctrl-Alt-LMB-drag instead.

To get Grease Pencil lasso select (in GP Editmode) to work in the Nodes Editor too,
this commit adds the Ctrl-Alt-LMB-drag binding here too. However, to make things easier,
this extra binding will be part of the Grease Pencil keymap everywhere. There doesn't
seem to be any conflicts with having this in place - until we find them, this should
be ok to have.

source/blender/editors/gpencil/gpencil_ops.c

index 9f5633ae6685bf2f891bd75876cfce1a469ad88c..d3520ef3e32c49605aff9a62f8499f85bbcde67c 100644 (file)
@@ -160,6 +160,15 @@ static void ed_keymap_gpencil_editing(wmKeyConfig *keyconf)
        kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT | KM_CTRL, 0);
        RNA_boolean_set(kmi->ptr, "deselect", true);
        
+       /* In the Node Editor, lasso select needs ALT modifier too (as somehow CTRL+LMB drag gets taken for "cut" quite early)
+        * There probably isn't too much harm adding this for other editors too as part of standard GP editing keymap. This hotkey
+        * combo doesn't seem to see much use under standard scenarios?
+        */
+       kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_CTRL | KM_ALT, 0);
+       RNA_boolean_set(kmi->ptr, "deselect", false);
+       kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT | KM_CTRL | KM_ALT, 0);
+       RNA_boolean_set(kmi->ptr, "deselect", true);
+       
        /* normal select */
        WM_keymap_add_item(keymap, "GPENCIL_OT_select", SELECTMOUSE, KM_PRESS, 0, 0);