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

Source Source/HoldToQuit.spoon/init.lua
duration
Signature HoldToQuit.duration
Type Variable
Description

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

Source Source/HoldToQuit.spoon/init.lua
hotkeyQbj
Signature HoldToQuit.hotkeyQbj
Type Variable
Description

Hotkey object

Source Source/HoldToQuit.spoon/init.lua
timer
Signature HoldToQuit.timer
Type Variable
Description

Timer for counting the holding time

Source Source/HoldToQuit.spoon/init.lua

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
Source Source/HoldToQuit.spoon/init.lua
init
Signature HoldToQuit:init()
Type Method
Description

Initialize spoon

Parameters:

  • None
Source Source/HoldToQuit.spoon/init.lua
killCurrentApp
Signature HoldToQuit.killCurrentApp
Type Method
Description

Kill the frontmost application

Parameters:

  • None
Source Source/HoldToQuit.spoon/init.lua
onKeyDown
Signature HoldToQuit:onKeyDown()
Type Method
Description

Start timer on keyDown

Parameters:

  • None
Source Source/HoldToQuit.spoon/init.lua
onKeyUp
Signature HoldToQuit:onKeyUp()
Type Method
Description

Stop Timer & show alert message

Parameters:

  • None
Source Source/HoldToQuit.spoon/init.lua
start
Signature HoldToQuit:start()
Type Method
Description

Start HoldToQuit with default hotkey

Parameters:

  • None
Source Source/HoldToQuit.spoon/init.lua
stop
Signature HoldToQuit:stop()
Type Method
Description

Disable HoldToQuit hotkey

Parameters:

  • None
Source Source/HoldToQuit.spoon/init.lua