From 7bcb9dc331f0668aafbac2391ae947f8a2d30d47 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 23 Apr 2019 07:40:59 +0200 Subject: [PATCH] keyboards: toggles options (#520) --- CHANGELOG.md | 2 ++ src/client/app/widgets/matrices/keyboard.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 942da93b..885aaace 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ - bug fixes - image: `cache` option inverted - image: allow whitespaces in url +- widgets + - keyboard: `toggles` options ## 0.45.6 diff --git a/src/client/app/widgets/matrices/keyboard.js b/src/client/app/widgets/matrices/keyboard.js index fde339d0..d8a44619 100644 --- a/src/client/app/widgets/matrices/keyboard.js +++ b/src/client/app/widgets/matrices/keyboard.js @@ -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 = ''