INNER CODE UNIT · TypeScript

registered

SimonAKing/scrcpy-gui · src/main/main.ts:282

    const registered = globalShortcut.register(shortcut, () => {
      stopAllScrcpy('boss-key')
      mainWindow?.hide()
    })
    if (!registered) return operationFailure('BOSS_KEY_UNAVAILABLE', 'boss-key', `The shortcut ${shortcut} is already in use.`)
    registeredBossKey = shortcut
    return { ok: true, data: shortcut }
  } catch (error) {
    return failureFromUnknown(error, 'BOSS_KEY_REGISTRATION_FAILED', 'boss-key', 'Unable to register the boss key.')
  }
}

function sendBatchProgress(progress: BatchProgressEvent): void {
  if (mainWindow && !mainWindow.isDestroyed()) mainWindow.webContents.send('batch:progress', progress)
  eventStore.publish({
    level: progress.status === 'failed' ? 'error' : progress.status === 'running' ? 'debug' : 'info',
    domain: 'artifact',
    action: progress.kind,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…