Handle Ctrl+/ in the application instead of via Electron
To prevent 'select all' on Linux.
This commit is contained in:
parent
3c6e23cc5e
commit
6b60ca6bd7
3 changed files with 22 additions and 2 deletions
|
@ -655,6 +655,15 @@
|
||||||
// NAVIGATION
|
// NAVIGATION
|
||||||
|
|
||||||
// Show keyboard shortcuts - handled by Electron-managed keyboard shortcuts
|
// Show keyboard shortcuts - handled by Electron-managed keyboard shortcuts
|
||||||
|
// However, on linux Ctrl+/ selects all text, so we prevent that
|
||||||
|
if (ctrlOrCommand && key === '/') {
|
||||||
|
window.showKeyboardShortcuts();
|
||||||
|
|
||||||
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Navigate by section
|
// Navigate by section
|
||||||
if (ctrlOrCommand && !shiftKey && (key === 't' || key === 'T')) {
|
if (ctrlOrCommand && !shiftKey && (key === 't' || key === 'T')) {
|
||||||
|
|
|
@ -217,7 +217,18 @@ export class MainHeader extends React.Component<PropsType, StateType> {
|
||||||
searchTerm,
|
searchTerm,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
if (event.key !== 'Escape') {
|
const { ctrlKey, metaKey, key } = event;
|
||||||
|
const ctrlOrCommand = ctrlKey || metaKey;
|
||||||
|
|
||||||
|
// On linux, this keyboard combination selects all text
|
||||||
|
if (ctrlOrCommand && key === '/') {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key !== 'Escape') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7560,7 +7560,7 @@
|
||||||
"rule": "React-createRef",
|
"rule": "React-createRef",
|
||||||
"path": "ts/components/MainHeader.js",
|
"path": "ts/components/MainHeader.js",
|
||||||
"line": " this.inputRef = react_1.default.createRef();",
|
"line": " this.inputRef = react_1.default.createRef();",
|
||||||
"lineNumber": 126,
|
"lineNumber": 134,
|
||||||
"reasonCategory": "usageTrusted",
|
"reasonCategory": "usageTrusted",
|
||||||
"updated": "2019-08-09T21:17:57.798Z",
|
"updated": "2019-08-09T21:17:57.798Z",
|
||||||
"reasonDetail": "Used only to set focus"
|
"reasonDetail": "Used only to set focus"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue