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;
|
e.editor.session.$emacsMark = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var keys = require("../lib/keys").KEY_MODS;
|
var keys = require("../lib/keys").KEY_MODS,
|
||||||
var eMods = {
|
eMods = {C: "ctrl", S: "shift", M: "alt", CMD: "command"},
|
||||||
C: "ctrl", S: "shift", M: "alt"
|
combinations = ["C-S-M-CMD",
|
||||||
};
|
"S-M-CMD", "C-M-CMD", "C-S-CMD", "C-S-M",
|
||||||
["S-C-M", "S-C", "S-M", "C-M", "S", "C", "M"].forEach(function(c) {
|
"M-CMD", "S-CMD", "S-M", "C-CMD", "C-M", "C-S",
|
||||||
|
"CMD", "M", "S", "C"];
|
||||||
|
combinations.forEach(function(c) {
|
||||||
var hashId = 0;
|
var hashId = 0;
|
||||||
c.split("-").forEach(function(c){
|
c.split("-").forEach(function(c) {
|
||||||
hashId = hashId | keys[eMods[c]];
|
hashId = hashId | keys[eMods[c]];
|
||||||
});
|
});
|
||||||
eMods[hashId] = c.toLowerCase() + "-";
|
eMods[hashId] = c.toLowerCase() + "-";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue