Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo Redo Key Binding #59

Closed
GoTeamScotch opened this issue Jan 20, 2016 · 3 comments
Closed

Undo Redo Key Binding #59

GoTeamScotch opened this issue Jan 20, 2016 · 3 comments
Labels

Comments

@GoTeamScotch
Copy link
Contributor

Issue: The keypresses "Z" and "Y" trigger undo/redo respectively BUT Z is also tied to Zoom, so while pressing Z you get both actions (undo & zoom) triggered. So, when you go to hit the zoom key, your last action is undone!

I fixed this issue by changing this:

{sel:'#tool_undo', fn: clickUndo, evt: 'click', key: ['Z', true]},
{sel:'#tool_redo', fn: clickRedo, evt: 'click', key: ['Y', true]},

To

{sel:'#tool_undo', fn: clickUndo, evt: 'click'},
{sel:'#tool_redo', fn: clickRedo, evt: 'click'},

Found in svg-editor.js around line 4020 (when not using compiled assets).

Undo / Redo can still be triggered by pressing [modKey] + Z or [modKey] + Y respectively so you're not losing anything with this change.

@codedread
Copy link
Member

Can you send a pull request?

@GoTeamScotch
Copy link
Contributor Author

Done. By the way, it seems like this is happening with the latest demo version (link on front page of the product's github page) so it doesn't seem to be an older version or anything to blame. I'm using Firefox 43.0.4.

P.s. this will NOT effect the compiled javascript file... so that would have to be done too.

codedread added a commit that referenced this issue Jan 21, 2016
#59 Remove double-bind of keypresses Z and Y
@brettz9
Copy link
Contributor

brettz9 commented May 31, 2018

Looks like this can be safely closed with the PR having been merged... Feel free to comment if otherwise...

@brettz9 brettz9 closed this as completed May 31, 2018
@brettz9 brettz9 added the bug label Sep 13, 2018
jfhenon added a commit that referenced this issue Mar 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants