keyboards: toggles options (#520)

This commit is contained in:
jean-emmanuel 2019-04-23 07:40:59 +02:00
parent dd2f626bc5
commit f9821b4bdd
2 changed files with 4 additions and 1 deletions

View file

@ -5,6 +5,8 @@
- bug fixes
- image: `cache` option inverted
- image: allow whitespaces in url
- widgets
- keyboard: `toggles` options
## 0.45.6

View file

@ -30,6 +30,7 @@ module.exports = class Keyboard extends _matrix_base {
'Set to `null` to send send no argument in the osc message',
'Can be an `object` if the type needs to be specified (see preArgs)'
]},
toggles: {type: 'boolean', value: false, help: 'Set to `true` to make keys bahave like toggle buttons'}
}, ['_value', 'default', 'value'], {
@ -68,7 +69,7 @@ module.exports = class Keyboard extends _matrix_base {
var data = JSON.parse(strData)
data.top = data.left = data.height = data.width = 'auto'
data.type = 'push'
data.type = this.getProp('toggles') ? 'toggle' : 'push'
data.id = this.getProp('id') + '/' + i
data.label = false
data.css = ''