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

Examples use event.metaKey to capture ctrlKey, but on Windows this does not work #1422

Closed
Nantris opened this issue Nov 19, 2017 · 7 comments

Comments

@Nantris
Copy link
Contributor

Nantris commented Nov 19, 2017

On Windows event.metaKey is false when using the Ctrl key. This leads to the plugin examples not working on Windows and the same for any other code copying this method: https://docs.slatejs.org/walkthroughs/using-plugins

@potatopotaro
Copy link

I might be mistaken, but I believe metaKey is the Windows button itself:

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/metaKey

Unless you're using Firefox > 48

@Nantris
Copy link
Contributor Author

Nantris commented Nov 21, 2017

Correct, but on Mac it's the Command Key (the Clover), which is used in place of Ctrl in Mac often if I'm not mistaken, for example Command+C to copy instead of Ctrl+C. Someone correct me if I'm wrong.

@Nantris
Copy link
Contributor Author

Nantris commented Nov 21, 2017

I realize by the way that I wasn't clear. This is only an issue in the guides such as: https://docs.slatejs.org/walkthroughs/using-plugins not in the /examples/ folder. I will try to get around to fixing these soon.

@Soreine
Copy link
Collaborator

Soreine commented Dec 11, 2017

What we did in slate-edit-table was to use is-hotkey to properly define shortcuts using the Mod alias. This was done by slate itself before.

@schneidmaster
Copy link
Collaborator

This should be fixed by #1601

@Nantris
Copy link
Contributor Author

Nantris commented Feb 23, 2018

Whoops. Really dropped the ball here. This was specifically about the walkthrough using metaKey instead of ctrlKey, which won't work for Windows.

Do the examples as written (now using ctrlKey) work on Mac? If so this issue is properly closed.

@schneidmaster
Copy link
Collaborator

Yep no worries! event.ctrlKey works as expected on Macs as well so I think we're all set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants