From 5c1ede2f01286f7aefd921e1caf86830880bbce2 Mon Sep 17 00:00:00 2001 From: Xelus22 Date: Sat, 30 Sep 2023 14:45:39 +1000 Subject: [PATCH] Add button control to docs --- docs/custom_ui.mdx | 27 +++++++++++++++++++++++- static/img/custom_ui_button_control.png | Bin 0 -> 9170 bytes 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 static/img/custom_ui_button_control.png diff --git a/docs/custom_ui.mdx b/docs/custom_ui.mdx index 17e9334..8ab8ea1 100644 --- a/docs/custom_ui.mdx +++ b/docs/custom_ui.mdx @@ -185,7 +185,13 @@ Example: `label` defines the text label on the left of the control -`type` defines the type of control. Valid values are `range`, `dropdown`, +`type` defines the type of control. Valid values are: +- `button` +- `toggle` +- `range` +- `dropdown` +- `color` +- `keycode` `options` defines the possible values of the control (the numerical range, or string/integer values) @@ -204,6 +210,25 @@ For example: ... defines a range (slider) UI control, labelled `Brightness`, with a range of 0 to 255. It will be using `channel_id` of `2` and `value_id` of `1` in the VIA protocol to set/get the value in the firmware. It has a `value_key` of `"id_qmk_rgblight_brightness"` because the `value_id` of `1` matches the integer value of `id_qmk_rgblight_brightness` in enum `id_qmk_rgblight` in the firmware code. +### Button Control + +The button control is a clickable that sends a numeric value. + + +![Custom UI Button Control](/img/custom_ui_button_control.png) + +```json +{ + "label": "Test button", + "type": "button", + "options": [10], + "content": ["id_test_button", 0, 3] +} +``` + +The `options` element defines value to be sent, e.g. `"options": [10],`. The value data is one byte (i.e. <=255), otherwise it is two bytes. See [Handling 16-bit Values](#handling-16-bit-values) for handling two byte values. + + ### Toggle Control The toggle control is a toggle switch that controls a boolean (on/off) value. diff --git a/static/img/custom_ui_button_control.png b/static/img/custom_ui_button_control.png new file mode 100644 index 0000000000000000000000000000000000000000..9de2f0f6e0076f8f7026a32cb343efd462ff97bf GIT binary patch literal 9170 zcmaL7RahKK(>01FI0Sbc+@0VMY;X+(hv4q+?lQPD1PSi$?jGD-1_=b$pZ$L4`dqZs zRd-kQQ?gb?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