Mac vs Windows: Command Key for Mac; CTRL key for windows

Viewed 686

I'm having trouble determining if this is possible. I want to add a shortcut to the app so that users can select all of the images on the page by typing the following:

On OSX: Command+A On Windows: CTRL+A

The issue is the Command+A combo in jQuery is done by checking the metaKey value. How do I bind the CTRL+A combo for windows, but ensure it doesn't get bound on Mac's?

1 Answers

I did find a good way to fix it. we have to determine the platform.

/mac/i.test(navigator.platform)
Related