mac: allow using Shift-Enter to complete capture

This commit is contained in:
Dima Gerasimov 2022-12-23 23:18:24 +00:00 committed by karlicoss
parent 83e7de9be9
commit 20022db1f6
2 changed files with 4 additions and 2 deletions

View file

@ -9,7 +9,7 @@ export function showNotification(text: string, priority: number=0) {
'title': "grasp",
'message': text,
'priority': priority,
'iconUrl': 'unicorn.png',
'iconUrl': 'img/unicorn.png',
});
}

View file

@ -74,7 +74,9 @@ function submitComment () {
// todo not sure if can define const here??
var ctrlEnterSubmit: KeyboardEventListener = (e) => {
if (e.ctrlKey && e.key === 'Enter') {
// note: there is also e.metaKey which triggers on mac when cmd is pressed
// but it doesn't seem to allow chords like cmd+Enter
if ((e.ctrlKey || e.shiftKey) && e.key === 'Enter') {
submitComment();
}
}