mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-08-04 21:53:14 +00:00
feature(key) rm disable/enable key bindings keys
This commit is contained in:
parent
e05bb10059
commit
c06fd26a52
2 changed files with 4 additions and 25 deletions
2
HELP.md
2
HELP.md
|
|
@ -107,8 +107,6 @@ Hot keys
|
|||
| `Ctrl + z` | clear buffer
|
||||
| `Ctrl + r` | refresh
|
||||
| `Ctrl + d` | clear local storage
|
||||
| `Alt + q` | disable key bindings
|
||||
| `Alt + s` | enable key bindings
|
||||
| `Ctrl + a` | select all files in a panel
|
||||
| `Up`, `Down`, `Enter` | filesystem navigation
|
||||
| `Ctrl + \` | go to the root directory
|
||||
|
|
|
|||
|
|
@ -109,24 +109,13 @@ var CloudCmd, Util, DOM;
|
|||
char = event.key;
|
||||
|
||||
/* если клавиши можно обрабатывать*/
|
||||
if (Binded) {
|
||||
if (Key.isBind())
|
||||
if (!alt && !ctrl && !meta && (isBetween || keyCode === KEY.DOT))
|
||||
setCurrentByLetter(char);
|
||||
else {
|
||||
Chars = [];
|
||||
switchKey(event);
|
||||
}
|
||||
|
||||
/* устанавливаем все обработчики
|
||||
* нажатий клавиш
|
||||
*/
|
||||
} else if (keyCode === Key.S && alt) {
|
||||
/* обрабатываем нажатия на клавиши*/
|
||||
Binded = true;
|
||||
Util.log('keybinds enabled');
|
||||
|
||||
Events.preventDefault(event);
|
||||
}
|
||||
}
|
||||
|
||||
function fromCharCode(keyIdentifier) {
|
||||
|
|
@ -193,7 +182,6 @@ var CloudCmd, Util, DOM;
|
|||
path = Info.path,
|
||||
keyCode = event.keyCode,
|
||||
shift = event.shiftKey,
|
||||
alt = event.altKey,
|
||||
ctrl = event.ctrlKey,
|
||||
meta = event.metaKey,
|
||||
ctrlMeta = ctrl || meta;
|
||||
|
|
@ -471,17 +459,10 @@ var CloudCmd, Util, DOM;
|
|||
if (ctrlMeta) {
|
||||
Util.log('clearing storage...');
|
||||
|
||||
DOM.Storage.clear();
|
||||
Events.preventDefault();
|
||||
}
|
||||
break;
|
||||
|
||||
/* убираем все обработчики нажатий клавиш */
|
||||
case Key.Q:
|
||||
if (alt) {
|
||||
Util.log('keybindings disabled');
|
||||
DOM.Storage.clear(function() {
|
||||
Util.log('storage cleared');
|
||||
});
|
||||
|
||||
Binded = false;
|
||||
Events.preventDefault(event);
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue