From 7dfc5029a3a804f274c2eae0f1dfd0321752f74a Mon Sep 17 00:00:00 2001 From: Bojan Zivkovic Date: Fri, 16 Mar 2018 23:00:33 -0400 Subject: [PATCH] Improving keyboard bindings code --- src/components/App.jsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/components/App.jsx b/src/components/App.jsx index da45152..f1a359e 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -75,17 +75,13 @@ export default class App extends React.Component { } componentDidMount() { - Mousetrap.bind(['ctrl+z'], this.onUndo.bind(this)); - Mousetrap.bind(['command+z'], this.onUndo.bind(this)); - Mousetrap.bind(['ctrl+y'], this.onRedo.bind(this)); - Mousetrap.bind(['command+shift+z'], this.onRedo.bind(this)); + Mousetrap.bind(['mod+z'], this.onUndo.bind(this)); + Mousetrap.bind(['mod+y', 'mod+shift+z'], this.onRedo.bind(this)); } componentWillUnmount() { - Mousetrap.unbind(['ctrl+z'], this.onUndo.bind(this)); - Mousetrap.unbind(['command+z'], this.onUndo.bind(this)); - Mousetrap.unbind(['ctrl+y'], this.onRedo.bind(this)); - Mousetrap.unbind(['command+shift+z'], this.onRedo.bind(this)); + Mousetrap.unbind(['mod+z'], this.onUndo.bind(this)); + Mousetrap.unbind(['mod+y', 'mod+shift+z'], this.onRedo.bind(this)); } onReset() {