Keymap: Use right-click for context menus in the animation editors
authorWilliam Reynish <billrey@me.com>
Tue, 7 May 2019 14:12:17 +0000 (16:12 +0200)
committerWilliam Reynish <billrey@me.com>
Tue, 7 May 2019 14:12:17 +0000 (16:12 +0200)
  - This only applies to left click select. Right click select and the legacy keymap are unaffected
  - You can still set the playhead from anywhere, using Shift-RMB, just like how you set the cursor in the 3D View

release/scripts/presets/keyconfig/keymap_data/blender_default.py

index b0c5ec7..52d6dc0 100644 (file)
@@ -1360,7 +1360,6 @@ def km_graph_editor(params):
     items.extend([
         ("wm.context_toggle", {"type": 'H', "value": 'PRESS', "ctrl": True},
          {"properties": [("data_path", 'space_data.show_handles')]}),
-        ("graph.cursor_set", {"type": params.action_mouse, "value": 'PRESS'}, None),
         ("graph.clickselect", {"type": params.select_mouse, "value": 'PRESS'},
          {"properties": [("extend", False), ("deselect_all", not params.legacy),
                          ("column", False), ("curves", False)]}),
@@ -1453,6 +1452,15 @@ def km_graph_editor(params):
         ("anim.end_frame_set", {"type": 'END', "value": 'PRESS', "ctrl": True}, None),
     ])
 
+    if params.select_mouse == 'LEFTMOUSE' and not params.legacy:
+        items.extend([
+            ("graph.cursor_set", {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True}, None),
+        ])
+    else:
+        items.extend([
+            ("graph.cursor_set", {"type": params.action_mouse, "value": 'PRESS'}, None),
+        ])
+
     if params.apple:
         items.extend([
             ("graph.copy", {"type": 'C', "value": 'PRESS', "oskey": True}, None),
@@ -2837,7 +2845,6 @@ def km_animation(params):
 
     items.extend([
         # Frame management.
-        ("anim.change_frame", {"type": params.action_mouse, "value": 'PRESS'}, None),
         ("wm.context_toggle", {"type": 'T', "value": 'PRESS', "ctrl": True},
          {"properties": [("data_path", 'space_data.show_seconds')]}),
         # Preview range.
@@ -2845,6 +2852,15 @@ def km_animation(params):
         ("anim.previewrange_clear", {"type": 'P', "value": 'PRESS', "alt": True}, None),
     ])
 
+    if params.select_mouse == 'LEFTMOUSE' and not params.legacy:
+        items.extend([
+            ("anim.change_frame", {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True}, None),
+        ])
+    else:
+        items.extend([
+            ("anim.change_frame", {"type": params.action_mouse, "value": 'PRESS'}, None),
+        ])
+
     return keymap