ritzyed / ritzy

Collaborative web-based rich text editor
http://ritzyed.github.io/ritzy/
Apache License 2.0
902 stars 52 forks source link

On OS X, shortcuts for text formatting should use the Command key #6

Closed mhodgson closed 9 years ago

mhodgson commented 9 years ago

Currently they use the control key, which is not consistent with any other editor on the platform.

rocketraman commented 9 years ago

The fix should be pretty easy, but I don't have a Mac. Are you (or anyone else) willing to test it for me?

mhodgson commented 9 years ago

@rocketraman sure. If you care to check it out, Keypress.js has feature parity with Mousetrap and can take care of the platform differences for you.

http://dmauro.github.io/Keypress/

In short, they give you the ability to define shortcuts as ‘meta b’ which maps to ‘control b’ on Windows and ‘command b’ on Mac.

rocketraman commented 9 years ago

@rocketraman sure. If you care to check it out, Keypress.js has feature parity with Mousetrap and can take care of the platform differences for you.

Thanks for the pointer. I remember looking at Keypress.js before and went with Mousetrap because the API seemed a bit simpler.

Just perusing the Mousetrap site again and it looks like Mousetrap now has the mod keyword for the same purpose:

Mousetrap 1.4 introduced a generic mod helper which lets you set cross platform shortcuts. Mousetrap.bind('mod+s', _saveDraft); On Mac this ends up mapping to command+s whereas on Windows and Linux it maps to ctrl+s.

I'll give it a shot!

mhodgson commented 9 years ago

:+1:

rocketraman commented 9 years ago

@mhodgson Can you checkout branch https://github.com/ritzyed/ritzy/tree/macosx-shortcuts and test for me please? You'll need a redis instance running. Then if you have npm and node v0.12 installed, you should be able to just npm install, gulp to run the server on port 5000.

rocketraman commented 9 years ago

I'll assume the fix worked and go ahead and commit this to master. Feel free to reopen / raise another issue if it is still a problem.

mhodgson commented 9 years ago

Looks good :+1: !