Cancel follow mode and console by Ctrl-C
This commit is contained in:
parent
428805e66f
commit
faba02ec21
2 changed files with 17 additions and 1 deletions
|
@ -72,6 +72,13 @@ class Console extends React.Component<Props> {
|
|||
break;
|
||||
case '[':
|
||||
if (e.ctrlKey) {
|
||||
e.preventDefault();
|
||||
return this.props.dispatch(consoleActions.hideCommand());
|
||||
}
|
||||
break;
|
||||
case 'c':
|
||||
if (e.ctrlKey) {
|
||||
e.preventDefault();
|
||||
return this.props.dispatch(consoleActions.hideCommand());
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -2,7 +2,16 @@ import * as dom from '../shared/utils/dom';
|
|||
import Key, * as keys from './domains/Key';
|
||||
|
||||
const cancelKey = (e: KeyboardEvent): boolean => {
|
||||
return e.key === 'Escape' || e.key === '[' && e.ctrlKey;
|
||||
if (e.key === 'Escape') {
|
||||
return true;
|
||||
}
|
||||
if (e.key === '[' && e.ctrlKey) {
|
||||
return true;
|
||||
}
|
||||
if (e.key === 'c' && e.ctrlKey) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
export default class InputDriver {
|
||||
|
|
Reference in a new issue