artursapek / mondrian

Web-based vector graphics editor
MIT License
1.24k stars 106 forks source link

Mac only shortcuts #1

Closed TronPaul closed 10 years ago

TronPaul commented 10 years ago

Please add windows/linux standard shortcuts for those OS's (ie CTRL-Z for undo)

artursapek commented 10 years ago

This needs to happen. Low-hanging fruit for any Windows people who want to contribute! Or I could steal my wife's laptop for an hour and do it myself.

Regardless, it's at the top of my list right now. Thanks.

Fishrock123 commented 10 years ago

Should we just consider the ctrl key as a cmd key? (or vice versa?) That seems like the most sane way to patch this.

(While it would be nice to use both separately on a mac, detecting if your on a mac in the web browser is tricky business.)

Fishrock123 commented 10 years ago

The only current use of the ctrl key is here.

Personally, I'm against having the ctl key do the same stuff as the cmd key on Mac, but I don't think there is a way to tell what OS the user is running & have separate Windows / Mac keybinds. :/

If its the only sane way, I'll rebase it into my keybindings refactor before it's pulled.

artursapek commented 10 years ago

There are several ways to detect if the user is on a Mac.

For example: http://www.javascripter.net/faq/operatin.htm

Fishrock123 commented 10 years ago

And that link reminded me that I actually used this in one of my own projects. facepalm

Fishrock123 commented 10 years ago

@TronPaul Try this version: https://searchbeam.jit.su/s/mondrian

Edit: O.K. Just tested it again, and it.. doesn't actually work now? Investigating. Edit2: I have no idea, this worked yesterday, the modifier codes are being set, yet ctrl-Z does not work. MouseEvent.metaKey issues.

Fishrock123 commented 10 years ago

@TronPaul Again, this time fixed: https://searchbeam.jit.su/s/mondrian

(try the hotkeys, like ctrl-z. The images are broken because my server serves static things at a different address than mondrian likes. Just ignore it)

Use http://staging.mondrian.io/ instead.