UNPKG

@guidepup/setup

Version:

Setup your environment for screen-reader automation.

30 lines (29 loc) 988 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.removeForegroundLock = removeForegroundLock; const regedit_1 = require("regedit"); const constants_1 = require("./constants"); const errors_1 = require("../errors"); async function removeForegroundLock() { try { await regedit_1.promisified.putValue({ [constants_1.SUB_KEY_CONTROL_PANEL_DESKTOP]: { [constants_1.FOREGROUND_LOCK_TIMEOUT_KEY]: { value: 0, type: "REG_DWORD", }, }, }); await regedit_1.promisified.putValue({ [constants_1.SUB_KEY_CONTROL_PANEL_DESKTOP]: { [constants_1.FOREGROUND_FLASH_COUNT_KEY]: { value: 0, type: "REG_DWORD", }, }, }); } catch (e) { throw new Error(`${errors_1.ERR_WINDOWS_UNABLE_TO_UPDATE_REGISTRY}\n\n${e.message}`); } }