Skip to content

Commit

Permalink
Move Command + z and Command + shift + z behavior to Scene
Browse files Browse the repository at this point in the history
  • Loading branch information
3b1b committed Apr 23, 2022
1 parent 2ba9243 commit 0fd8491
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 0 additions & 4 deletions manimlib/scene/interactive_scene.py
Expand Up @@ -398,10 +398,6 @@ def on_key_press(self, symbol: int, modifiers: int) -> None:
self.ungroup_selection()
elif char == "t" and modifiers == COMMAND_MODIFIER:
self.toggle_selection_mode()
elif char == "z" and modifiers == COMMAND_MODIFIER:
self.undo()
elif char == "z" and modifiers == COMMAND_MODIFIER | SHIFT_MODIFIER:
self.redo()
elif char == "s" and modifiers == COMMAND_MODIFIER:
self.save_selection_to_file()
elif symbol in ARROW_SYMBOLS:
Expand Down
6 changes: 5 additions & 1 deletion manimlib/scene/scene.py
Expand Up @@ -2,7 +2,6 @@

from functools import wraps
import inspect
import itertools as it
import os
import platform
import random
Expand All @@ -17,6 +16,7 @@
from manimlib.constants import ARROW_SYMBOLS
from manimlib.constants import DEFAULT_WAIT_TIME
from manimlib.constants import COMMAND_MODIFIER
from manimlib.constants import SHIFT_MODIFIER
from manimlib.event_handler import EVENT_DISPATCHER
from manimlib.event_handler.event_type import EventType
from manimlib.logger import log
Expand Down Expand Up @@ -785,6 +785,10 @@ def on_key_press(

if char == RESET_FRAME_KEY:
self.camera.frame.to_default_state()
elif char == "z" and modifiers == COMMAND_MODIFIER:
self.undo()
elif char == "z" and modifiers == COMMAND_MODIFIER | SHIFT_MODIFIER:
self.redo()
# command + q
elif char == QUIT_KEY and modifiers == COMMAND_MODIFIER:
self.quit_interaction = True
Expand Down

0 comments on commit 0fd8491

Please sign in to comment.