Graph Editor part of the changes in the previous commit...
[blender.git] / source / blender / editors / space_graph / graph_ops.c
index efec8dc4259ec1366b45616ef0bfcc703ee0dc24..e5aca9cb12168c8f6f1f488c303c51dd7d2789a2 100644 (file)
@@ -235,6 +235,7 @@ void graphedit_operatortypes(void)
        WM_operatortype_append(GRAPH_OT_select_linked);
        WM_operatortype_append(GRAPH_OT_select_more);
        WM_operatortype_append(GRAPH_OT_select_less);
+       WM_operatortype_append(GRAPH_OT_select_leftright);
        
                /* editing */
        WM_operatortype_append(GRAPH_OT_snap);
@@ -287,14 +288,22 @@ static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap)
        kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT|KM_SHIFT, 0);
                RNA_boolean_set(kmi->ptr, "extend", 1);
                RNA_boolean_set(kmi->ptr, "column", 1);
-       kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
-               RNA_enum_set(kmi->ptr, "left_right", GRAPHKEYS_LRSEL_TEST);
        kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0);
                RNA_boolean_set(kmi->ptr, "curves", 1);
        kmi= WM_keymap_add_item(keymap, "GRAPH_OT_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT|KM_SHIFT, 0);
                RNA_boolean_set(kmi->ptr, "curves", 1);
                RNA_boolean_set(kmi->ptr, "extend", 1);
        
+       /* select left/right */
+       WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
+       kmi= WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
+               RNA_boolean_set(kmi->ptr, "extend", 1);
+       
+       kmi= WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", LEFTBRACKETKEY, KM_PRESS, 0, 0);
+               RNA_enum_set(kmi->ptr, "mode", GRAPHKEYS_LRSEL_LEFT);
+       kmi= WM_keymap_add_item(keymap, "GRAPH_OT_select_leftright", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
+               RNA_enum_set(kmi->ptr, "mode", GRAPHKEYS_LRSEL_RIGHT);
+       
                /* deselect all */
        WM_keymap_add_item(keymap, "GRAPH_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
        RNA_boolean_set(WM_keymap_add_item(keymap, "GRAPH_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1);