Global

Methods

click(btn)object

Returns an object with pointing_button property, which can be passed to Rule#remap as from or to properties.

Parameters:
Name Type Description
btn string

button name

  • button1
  • button2
  • button3
  • left (alias for button1)
  • right (alias for button2)
  • middle (alias for button3)
Returns:

an object like: { pointing_button: ... }

Type:
object

if_app(…idrpt)object

Returns an object with type: 'frontmost_application_if' property, which can be passed to Rule#cond as a condition.

Parameters:
Name Type Description
idrpt string

application id

Returns:

an object like: { type: 'frontmost_application_if', ... }

Type:
object

if_lang(…langrpt)object

Returns an object with type: 'input_source_if' property, which can be passed to Rule#cond as a condition.

Parameters:
Name Type Description
langrpt string

language code

Returns:

an object like: { type: 'input_source_if', ... }

Type:
object

if_var(name, value)object

Returns an object with type: 'variable_if' property, which can be passed to Rule#cond as a condition.

Parameters:
Name Type Description
name string

variable name

value
  • string
  • number

value to check

Returns:

an object like: { type: 'variable_if', ... }

Type:
object

key(code, mods, optsopt)object

Returns an object with key_code property,
which can be passed to Rule#remap as from or to properties.

Parameters:
Name Type Description
code
  • string
  • string[]
  • array[]

key code(s)

mods
  • string
  • object
  • string[]

modifiers

optsopt object

optional properties

Returns:

an object like: { key_code: ... }

Type:
object

set_var(name, value, optsopt)object

Returns an object with set_variable property, which can be passed to Rule#remap as to property.

Parameters:
Name Type Description
name string

variable name

value
  • string
  • number

value to assign

optsopt object

optional properties

Returns:

an object like: { set_variable: { ... } }

Type:
object

unless_app(…idrpt)object

Returns an object with type: 'frontmost_application_unless' property, which can be passed to Rule#cond as a condition.

Parameters:
Name Type Description
idrpt string

application id

Returns:

an object like: { type: 'frontmost_application_unless', ... }

Type:
object

unless_lang(…langrpt)object

Returns an object with type: 'input_source_unless' property, which can be passed to Rule#cond as a condition.

Parameters:
Name Type Description
langrpt string

language code

Returns:

an object like: { type: 'input_source_unless', ... }

Type:
object

unless_var(name, value)object

Returns an object with type: 'variable_unless' property, which can be passed to Rule#cond as a condition.

Parameters:
Name Type Description
name string

variable name

value
  • string
  • number

value to check

Returns:

an object like: { type: 'variable_unless', ... }

Type:
object