Skip to content

Commit

Permalink
fix: block event listener during OCR
Browse files Browse the repository at this point in the history
fixes #23
  • Loading branch information
marcincichocki authored Mar 28, 2021
1 parent cf9fe24 commit f4c69c4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@ import ora from 'ora';

const displays = await screenshot.listDisplays();
const screenId = await getScreenId(displays);
let isRunning = false;

iohook.registerShortcut(options.keyBind, async () => {
if (isRunning) return;
isRunning = true;

await main(workers, screenId);

console.info(t`READY`);
isRunning = false;
});

iohook.start();
Expand Down

0 comments on commit f4c69c4

Please sign in to comment.