docs » HoldToQuit

Instead of pressing ⌘Q, hold ⌘Q to close applications.

API Overview

API Documentation

Variables

defaultHotkey
Signature HoldToQuit.defaultHotkey
Type Variable
Description

Default hotkey mapping

duration
Signature HoldToQuit.duration
Type Variable
Description

Integer containing the duration (in seconds) how long to hold the hotkey. Default 1.

hotkeyQbj
Signature HoldToQuit.hotkeyQbj
Type Variable
Description

Hotkey object

timer
Signature HoldToQuit.timer
Type Variable
Description

Timer for counting the holding time

Methods

bindHotkeys
Signature HoldToQuit:bindHotkeys(mapping)
Type Method
Description

Binds hotkeys for HoldToQuit

Parameters:

  • mapping - A table containing hotkey modifier/key details for the following items:
    • show - This will define the quit hotkey
init
Signature HoldToQuit:init()
Type Method
Description

Initialize spoon

killCurrentApp
Signature HoldToQuit.killCurrentApp
Type Method
Description

Kill the frontmost application

onKeyDown
Signature HoldToQuit:onKeyDown()
Type Method
Description

Start timer on keyDown

onKeyUp
Signature HoldToQuit:onKeyUp()
Type Method
Description

Stop Timer & show alert message

start
Signature HoldToQuit:start()
Type Method
Description

Start HoldToQuit with default hotkey

stop
Signature HoldToQuit:stop()
Type Method
Description

Disable HoldToQuit hotkey