fat / zoom.js

Medium's Image Zoom for jQuery
https://fat.github.io/zoom.js
MIT License
4.04k stars 332 forks source link

No support for users without a meta key? #23

Closed ghost closed 9 years ago

jdreesen commented 9 years ago

There was a discussion on this topic here #3 It seems that at least windows doesn't have a meta key and thus isn't supported atm :/

ghost commented 9 years ago

I've read the discussion - my keyboard has the "⊞" key, but it cannot be picked up by my browser since it's a OS specific key in Linux (Debian at least). It's not even a windows issue, it's a non-OSX issue. Linux, BSD, and Windows users will all have this.

evanfuture commented 9 years ago

What key do you hold down while clicking a link so that it opens in a new tab?

jdreesen commented 9 years ago

On Windows I use ctrl for this.

evanfuture commented 9 years ago

Right, the problem is then that on windows, the Meta key is the Windows key, which doesn't really do what's expected. http://api.jquery.com/event.metakey/

nofxx commented 9 years ago

There's no meta key on linux (according to jquery)... Listen to 'ctrl' key code? Won't hurt on OSX and fixes win and linux.

evanfuture commented 9 years ago

Well, on OSX the ctrl key brings up the contextual menu....

I suppose checking for user agent is too big a footprint?

fat commented 9 years ago

yeah don't want to do ctrl key because of the menu problem

arjshiv commented 9 years ago

@fat - Thanks for making this awesome plugin. I came across this as I was looking at trending Javascript projects on GitHub.

My understanding is that e.ctrlKey does;t actually fire when you use the ctrl key on Mac - so you are safe to use metaKey for Mac and ctrl key for Windows. I actually use this in one of my corporate applications - metaKey+click on Mac, ctrl+click on Windows. A quick debug+inspect in safari when clicking on the image in http://fat.github.io/zoom.js/ also shows that e.ctrlKey doesn't fire when I use ctrl+click on a Mac. If this is good with you, I'd love to pull and make the enhancement.

fat commented 9 years ago

fixed!

jdreesen commented 9 years ago

nice, thx! :)