diff --git a/manimlib/default_config.yml b/manimlib/default_config.yml index 098c6c45d5..b6af75bc85 100644 --- a/manimlib/default_config.yml +++ b/manimlib/default_config.yml @@ -116,6 +116,7 @@ key_bindings: grab: "g" x_grab: "h" y_grab: "v" + z_grab: "z" resize: "t" color: "c" information: "i" diff --git a/manimlib/scene/interactive_scene.py b/manimlib/scene/interactive_scene.py index c4a4214f23..18389b5143 100644 --- a/manimlib/scene/interactive_scene.py +++ b/manimlib/scene/interactive_scene.py @@ -42,7 +42,8 @@ GRAB_KEY = manim_config.key_bindings.grab X_GRAB_KEY = manim_config.key_bindings.x_grab Y_GRAB_KEY = manim_config.key_bindings.y_grab -GRAB_KEYS = [GRAB_KEY, X_GRAB_KEY, Y_GRAB_KEY] +Z_GRAB_KEY = manim_config.key_bindings.z_grab +GRAB_KEYS = [GRAB_KEY, X_GRAB_KEY, Y_GRAB_KEY, Z_GRAB_KEY] RESIZE_KEY = manim_config.key_bindings.resize # TODO COLOR_KEY = manim_config.key_bindings.color INFORMATION_KEY = manim_config.key_bindings.information @@ -528,7 +529,7 @@ def on_key_press(self, symbol: int, modifiers: int) -> None: self.add(self.crosshair) # Conditions for saving state - if char in [GRAB_KEY, X_GRAB_KEY, Y_GRAB_KEY, RESIZE_KEY]: + if char in [GRAB_KEY, X_GRAB_KEY, Y_GRAB_KEY, Z_GRAB_KEY, RESIZE_KEY]: self.save_state() def on_key_release(self, symbol: int, modifiers: int) -> None: @@ -551,6 +552,8 @@ def handle_grabbing(self, point: Vect3): self.selection.set_x(diff[0]) elif self.window.is_key_pressed(ord(Y_GRAB_KEY)): self.selection.set_y(diff[1]) + elif self.window.is_key_pressed(ord(Z_GRAB_KEY)): + self.selection.set_z(diff[2]) def handle_resizing(self, point: Vect3): if not hasattr(self, "scale_about_point"):