docs: add keys docs
This commit is contained in:
parent
184f8d203a
commit
e4996e1d53
1 changed files with 42 additions and 0 deletions
|
|
@ -29,3 +29,45 @@
|
|||
- type: `string`
|
||||
- default: `empty`
|
||||
- usage: `unit` will be appended to the displayed widget's value (it doesn't affect osc messages)
|
||||
|
||||
|
||||
## Keys
|
||||
|
||||
|
||||
```js
|
||||
{
|
||||
type:'keys',
|
||||
// etc
|
||||
}
|
||||
```
|
||||
|
||||
### `widgetId`
|
||||
- type: `object`
|
||||
- default: `empty`
|
||||
- usage: a widget's `id` whose value will be linked to the Keys
|
||||
|
||||
### `binding`
|
||||
- type: `string|array`
|
||||
- default: `''`
|
||||
- usage: [keyboardjs](https://github.com/RobertWHurst/KeyboardJS) key combo string or array of strings.
|
||||
|
||||
### `keydown`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage: [MathJS](http://mathjs.org/docs/expressions/syntax.html) expression whose output will be sent to the linked widget. This will be evaluated when the key combo is pressed. Available variables are ;
|
||||
- `value`: widget's value
|
||||
- `key`: pressed key name (usefull for handling multiple keys with a single `keys` widget)
|
||||
- `ctrl`: control key state
|
||||
- `alt`: alt key state
|
||||
- `shift`: shift key state
|
||||
- `super`: command/windows key state
|
||||
|
||||
### `keyup`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage: same as `keydown`, but evaluated when releasing the key combo.
|
||||
|
||||
### `repeat`
|
||||
- type: `boolean`
|
||||
- default: `true`
|
||||
- usage: set to `false` to prevent `keydown` repeats when holding the key combo pressed.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue