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 line 22
duration
Signature HoldToQuit.duration
Type Variable
Description

Integer containing the duration (in seconds) how long to hold

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

Hotkey object

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

Timer for counting the holding time

Source Source/HoldToQuit.spoon/init.lua line 34

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

Initialize spoon

Parameters
  • None
Returns
Source Source/HoldToQuit.spoon/init.lua line 50
killCurrentApp
Signature HoldToQuit.killCurrentApp()
Type Method
Description

Kill the frontmost application

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

Start timer on keyDown

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

Stop Timer & show alert message

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

Start HoldToQuit with default hotkey

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

Disable HoldToQuit hotkey

Parameters
  • None
Returns
Source Source/HoldToQuit.spoon/init.lua line 100