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
|
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
|
|
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
|
|
key code(s) |
mods
|
|
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
|
|
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
|
|
value to check |
Returns:
an object like: { type: 'variable_unless', ... }
- Type:
- object
Type Definitions
Keymap
A keymap definition which can be passed to Rule#remap as from or to properties.
It can be an object like { key_code: 'a', ... }, or a string in the special format.
Object Format
A plain object that loosely follows the Karabiner's specifications.
key function returns in this format.
String Format
A special expression that is only supported by Karabinerge for user's convenience.
Here are some examples:
| Expression | Meaning |
|---|---|
'a' |
a key |
'shift + a' |
a key with shift modifier |
'shift + control + a' |
a key with shift + control modifiers |
'shift + (control) + a' |
a key with shift + optional control modifiers |
- Type:
-
- object
- string