Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Flip ctrlKey and metaKey properties on Opera Mac

I don't know what they were thinking, but this, on
recent Opera versions, seems to give the correct
result.

Closes #10
  • Loading branch information...
commit 54095aac018b76c8cc29a234fcc2f79ce8cab622 1 parent 949bcc4
@marijnh marijnh authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/codemirror.js
View
5 lib/codemirror.js
@@ -612,10 +612,11 @@ window.CodeMirror = (function() {
}, 50);
var name = keyNames[e_prop(e, "keyCode")], handled = false;
+ var flipCtrlCmd = opera && mac;
if (name == null || e.altGraphKey) return false;
if (e_prop(e, "altKey")) name = "Alt-" + name;
- if (e_prop(e, "ctrlKey")) name = "Ctrl-" + name;
- if (e_prop(e, "metaKey")) name = "Cmd-" + name;
+ if (e_prop(e, flipCtrlCmd ? "metaKey" : "ctrlKey")) name = "Ctrl-" + name;
+ if (e_prop(e, flipCtrlCmd ? "ctrlKey" : "metaKey")) name = "Cmd-" + name;
var stopped = false;
function stop() { stopped = true; }
Please sign in to comment.
Something went wrong with that request. Please try again.