question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
schneidmastercommented, Feb 23, 2018

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

1reaction
Slapboxcommented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

KeyboardEvent.metaKey - Web APIs | MDN
The KeyboardEvent.metaKey read-only property returning a boolean value that indicates if the Meta key was pressed (true) or not (false) when ...
Read more >
How does one capture a Mac's command key via JavaScript?
It seems that event.metaKey works in the current versions of Safari, Firefox and Chrome like a charm. IMO it is much clear solution....
Read more >
#3368 (event.metaKey should be assigned to event.ctrlKey on ...
metaKey = event.ctrlKey;. This is causing a buggy behavior in the following scenario: A user wish to bind ctrl+x to function-A and command ......
Read more >
Detect ctrl/cmd/alt/shift + Click in Vanilla JavaScript, React and ...
All of metaKey , ctrlKey , altKey and shiftKey are booleans, ... command/windows (meta), alt and shift click detection is the following:.
Read more >
Javascript Keyboard Events for multiple Operating Systems
The ctrlKey property of the event does indeed map to the ctrl key in ... The metaKey property does not seem to work...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found