Open GoogleCodeExporter opened 9 years ago
1) figure out a way to determine the platform
var isMac = (navigator.platform.indexOf("Mac") != -1);
For 2 & 3) I've done this in my working copy and it works as expected in
Firefox and
Safari. Unfortunately, neither Chrome or Opera play nice with this.
So options are:
a) leave key bindings as they are (so they are consistent across browsers
b) bind to ctrl+/meta+ in firefox and safari only
I'm going with option a) right now.
Original comment by codedr...@gmail.com
on 7 Aug 2009 at 7:04
Original comment by codedr...@gmail.com
on 11 Aug 2009 at 2:47
Alright, here's my fairly extensive testing on ctrlKey and metaKey on Mac OSX
for the latest versions of all browsers. Tested for keypress, keyup and keydown
events, which often influence each other depending on which is set. Also tested
whether preventDefault works.
Safari:
metaKey: Only keypress if keydown is not set, never fires for keyup
ctrlKey: Only keypress if keydown is not set
Opera: - Fires metaKey for ctrlKey and ctrlKey for metaKey! Crazy!
metaKey: Only keydown and keypress, CANNOT prevent default
ctrlKey: Only keydown and keypress
Firefox
metaKey: Only keydown and keypress
ctrlKey: All
Chrome:
metaKey: Only keydown, CANNOT prevent default
ctrlKey: keypress only on SOME keys, keydown and keyup on all
No tests have yet been done in conjunction with the hotkey script, figured I
should test basic support first.
Original comment by adeve...@gmail.com
on 27 Sep 2010 at 7:49
So it comes down to this: Use only keydown, and keep in mind CMD+(anything)
cannot prevent the default behavior in Opera or Chrome. However the cut, copy &
paste keys should be harmless to use, so I say we still use CMD+ for them, and
be careful with others.
Original comment by adeve...@gmail.com
on 27 Sep 2010 at 8:25
One alternative is to support both -- Ctrl and Cmd -- and then whichever one
people try to use, it works for them.
Original comment by ashe...@asheesh.org
on 6 Apr 2013 at 3:38
Original issue reported on code.google.com by
codedr...@gmail.com
on 7 Aug 2009 at 5:31