From 79b0f9168eafef1642f3223500197bf630a2433f Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Mon, 27 Mar 2023 20:01:07 +0100 Subject: Custom keycodes in JSON (#19925) --- data/schemas/definitions.jsonschema | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'data/schemas/definitions.jsonschema') diff --git a/data/schemas/definitions.jsonschema b/data/schemas/definitions.jsonschema index 94a94157c0..b9c64a55ec 100644 --- a/data/schemas/definitions.jsonschema +++ b/data/schemas/definitions.jsonschema @@ -71,6 +71,38 @@ "type": "string", "pattern": "^[0-9a-z][0-9a-z_/]*$" }, + "keycode": { + "type": "string", + "minLength": 2, + "maxLength": 50, + "pattern": "^[A-Z][A-Zs_0-9]*$" + }, + "keycode_short": { + "type": "string", + "minLength": 2, + "maxLength": 7, + "pattern": "^[A-Z][A-Zs_0-9]*$" + }, + "keycode_decl": { + "type": "object", + "required": [ + "key" + ], + "properties": { + "key": {"$ref": "#/keycode"}, + "label": {"$ref": "#/text_identifier"}, + "aliases": { + "type": "array", + "minItems": 1, + "items": {"$ref": "#/keycode_short"} + } + } + }, + "keycode_decl_array": { + "type": "array", + "minItems": 1 + "items": {"$ref": "#/keycode_decl"} + }, "mcu_pin_array": { "type": "array", "items": {"$ref": "#/mcu_pin"} -- cgit v1.2.3