adding command key to emacs keyhandler.
usage:
keyHandler.bindKey("CMD-g": "someNewCommand")
This commit is contained in:
parent
50a6bd21af
commit
9fd93a5e37
1 changed files with 8 additions and 6 deletions
|
|
@ -134,13 +134,15 @@ var $resetMarkMode = function(e) {
|
|||
e.editor.session.$emacsMark = null;
|
||||
}
|
||||
|
||||
var keys = require("../lib/keys").KEY_MODS;
|
||||
var eMods = {
|
||||
C: "ctrl", S: "shift", M: "alt"
|
||||
};
|
||||
["S-C-M", "S-C", "S-M", "C-M", "S", "C", "M"].forEach(function(c) {
|
||||
var keys = require("../lib/keys").KEY_MODS,
|
||||
eMods = {C: "ctrl", S: "shift", M: "alt", CMD: "command"},
|
||||
combinations = ["C-S-M-CMD",
|
||||
"S-M-CMD", "C-M-CMD", "C-S-CMD", "C-S-M",
|
||||
"M-CMD", "S-CMD", "S-M", "C-CMD", "C-M", "C-S",
|
||||
"CMD", "M", "S", "C"];
|
||||
combinations.forEach(function(c) {
|
||||
var hashId = 0;
|
||||
c.split("-").forEach(function(c){
|
||||
c.split("-").forEach(function(c) {
|
||||
hashId = hashId | keys[eMods[c]];
|
||||
});
|
||||
eMods[hashId] = c.toLowerCase() + "-";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue