AnitaTang / js-hotkeys

Automatically exported from code.google.com/p/js-hotkeys
0 stars 0 forks source link

Re: Adding support for Mac command (meta) key #31

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

Issue 26 http://code.google.com/p/js-hotkeys/issues/detail?id=26 claims to 
be fixed however as of version 0.7.8 there is still no support for the 
command key. I have included a very simple patch below which solves this 
problem by looking at the metaKey property of the key event object. I hope 
you will include this in a future version.

Diff against http://js-hotkeys.googlecode.com/files/jquery.hotkeys-0.7.8.js
---------------------------------------------------------------------------
184a185
>                 meta = event.metaKey,            
201c202
<                 if(!shift && !ctrl && !alt) { // No Modifiers

---
>                 if(!shift && !ctrl && !alt && !meta) { // No Modifiers
205c206
<                     // check combinations (alt|ctrl|shift+anything)

---
>                     // check combinations (alt|ctrl|shift|meta+anything)
209a211
>                     if(meta) modif += 'meta+';

Original issue reported on code.google.com by tamlyn.r...@gmail.com on 16 Oct 2008 at 11:21

Attachments:

GoogleCodeExporter commented 8 years ago
while trying to fix this issue I found a bug in jQuery
look at:
http://groups.google.com/group/jquery-dev/browse_thread/thread/649c075936c9c278
and
http://dev.jquery.com/ticket/3368

I see no point of fixing it twice - so decided for next jQuery release in order 
to
add this to the plug-in

Original comment by Afro.Sys...@gmail.com on 16 Oct 2008 at 11:49

GoogleCodeExporter commented 8 years ago
Ah I see. In the meantime though it would be useful to recognise the meta key 
to 
avoid the common situation of listening for 'x' and wrongly capturing 
'command-x' 
(e.g. command-t for new tab).

Original comment by tamlyn.r...@gmail.com on 16 Oct 2008 at 11:55

GoogleCodeExporter commented 8 years ago
Has development on this plugin halted?  I will note that your patch is still 
not into
the trunk (0.7.9).

I will also note that Opera and Chrome seem to ignore Ctrl+ and Cmd+ (meta) key
bindings.  That sucks.  Work around?

Original comment by codedr...@gmail.com on 7 Aug 2009 at 7:22

GoogleCodeExporter commented 8 years ago
I downloaded 0.7.9 today and still there is no meta fix, its 2011 already :/

Original comment by cor...@aldomx.com on 14 Jan 2011 at 6:57