summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2025-02-26 22:25:41 +1100
committerGitHub <noreply@github.com>2025-02-26 22:25:41 +1100
commit1efc82403bebe759272d1ba7a79d9dfa0d5df506 (patch)
treec356ae7afeb0849926534beb5dd4515f693abf99 /data
parent63b095212b157c4522bdeda3de144fb87213085d (diff)
Community modules (#24848)
Diffstat (limited to 'data')
-rw-r--r--data/constants/keycodes/keycodes_0.0.7.hjson7
-rw-r--r--data/constants/module_hooks/0.1.0.hjson25
-rw-r--r--data/constants/module_hooks/1.0.0.hjson26
-rw-r--r--data/schemas/community_module.jsonschema17
-rw-r--r--data/schemas/keyboard.jsonschema17
-rw-r--r--data/schemas/keymap.jsonschema6
6 files changed, 93 insertions, 5 deletions
diff --git a/data/constants/keycodes/keycodes_0.0.7.hjson b/data/constants/keycodes/keycodes_0.0.7.hjson
new file mode 100644
index 0000000000..52e1a50443
--- /dev/null
+++ b/data/constants/keycodes/keycodes_0.0.7.hjson
@@ -0,0 +1,7 @@
1{
2 "ranges": {
3 "0x77C0/0x003F": {
4 "define": "QK_COMMUNITY_MODULE"
5 }
6 }
7}
diff --git a/data/constants/module_hooks/0.1.0.hjson b/data/constants/module_hooks/0.1.0.hjson
new file mode 100644
index 0000000000..c77f4c297e
--- /dev/null
+++ b/data/constants/module_hooks/0.1.0.hjson
@@ -0,0 +1,25 @@
1{
2 keyboard_pre_init: {
3 ret_type: void
4 args: void
5 }
6 keyboard_post_init: {
7 ret_type: void
8 args: void
9 }
10 pre_process_record: {
11 ret_type: bool
12 args: uint16_t keycode, keyrecord_t *record
13 call_params: keycode, record
14 }
15 process_record: {
16 ret_type: bool
17 args: uint16_t keycode, keyrecord_t *record
18 call_params: keycode, record
19 }
20 post_process_record: {
21 ret_type: void
22 args: uint16_t keycode, keyrecord_t *record
23 call_params: keycode, record
24 }
25}
diff --git a/data/constants/module_hooks/1.0.0.hjson b/data/constants/module_hooks/1.0.0.hjson
new file mode 100644
index 0000000000..4e7bf30412
--- /dev/null
+++ b/data/constants/module_hooks/1.0.0.hjson
@@ -0,0 +1,26 @@
1{
2 housekeeping_task: {
3 ret_type: void
4 args: void
5 }
6 suspend_power_down: {
7 ret_type: void
8 args: void
9 }
10 suspend_wakeup_init: {
11 ret_type: void
12 args: void
13 }
14 shutdown: {
15 ret_type: bool
16 args: bool jump_to_bootloader
17 call_params: jump_to_bootloader
18 }
19 process_detected_host_os: {
20 ret_type: bool
21 args: os_variant_t os
22 call_params: os
23 guard: defined(OS_DETECTION_ENABLE)
24 header: os_detection.h
25 }
26}
diff --git a/data/schemas/community_module.jsonschema b/data/schemas/community_module.jsonschema
new file mode 100644
index 0000000000..a3474476df
--- /dev/null
+++ b/data/schemas/community_module.jsonschema
@@ -0,0 +1,17 @@
1{
2 "$schema": "https://json-schema.org/draft/2020-12/schema#",
3 "$id": "qmk.community_module.v1",
4 "title": "Community Module Information",
5 "type": "object",
6 "required": ["module_name", "maintainer"]
7 "properties": {
8 "module_name": {"$ref": "qmk.definitions.v1#/text_identifier"},
9 "maintainer": {"$ref": "qmk.definitions.v1#/text_identifier"},
10 "url": {
11 "type": "string",
12 "format": "uri"
13 },
14 "keycodes": {"$ref": "qmk.definitions.v1#/keycode_decl_array"},
15 "features": {"$ref": "qmk.keyboard.v1#/definitions/features_config"},
16 }
17}
diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema
index 8b6cc7032b..9b63f62d45 100644
--- a/data/schemas/keyboard.jsonschema
+++ b/data/schemas/keyboard.jsonschema
@@ -31,6 +31,11 @@
31 "pins": {"$ref": "qmk.definitions.v1#/mcu_pin_array"} 31 "pins": {"$ref": "qmk.definitions.v1#/mcu_pin_array"}
32 } 32 }
33 } 33 }
34 "features_config": {
35 "$ref": "qmk.definitions.v1#/boolean_array",
36 "propertyNames": {"$ref": "qmk.definitions.v1#/snake_case"},
37 "not": {"required": ["lto"]}
38 },
34 }, 39 },
35 "type": "object", 40 "type": "object",
36 "not": {"required": ["vendorId", "productId"]}, // reject via keys... 41 "not": {"required": ["vendorId", "productId"]}, // reject via keys...
@@ -328,11 +333,7 @@
328 "enabled": {"type": "boolean"} 333 "enabled": {"type": "boolean"}
329 } 334 }
330 }, 335 },
331 "features": { 336 "features": { "$ref": "#/definitions/features_config" },
332 "$ref": "qmk.definitions.v1#/boolean_array",
333 "propertyNames": {"$ref": "qmk.definitions.v1#/snake_case"},
334 "not": {"required": ["lto"]}
335 },
336 "indicators": { 337 "indicators": {
337 "type": "object", 338 "type": "object",
338 "properties": { 339 "properties": {
@@ -467,6 +468,12 @@
467 "rows": {"$ref": "qmk.definitions.v1#/mcu_pin_array"} 468 "rows": {"$ref": "qmk.definitions.v1#/mcu_pin_array"}
468 } 469 }
469 }, 470 },
471 "modules": {
472 "type": "array",
473 "items": {
474 "type": "string"
475 }
476 },
470 "mouse_key": { 477 "mouse_key": {
471 "type": "object", 478 "type": "object",
472 "properties": { 479 "properties": {
diff --git a/data/schemas/keymap.jsonschema b/data/schemas/keymap.jsonschema
index e967e45c53..b92a536c2c 100644
--- a/data/schemas/keymap.jsonschema
+++ b/data/schemas/keymap.jsonschema
@@ -71,6 +71,12 @@
71 "config": {"$ref": "qmk.keyboard.v1"}, 71 "config": {"$ref": "qmk.keyboard.v1"},
72 "notes": { 72 "notes": {
73 "type": "string" 73 "type": "string"
74 },
75 "modules": {
76 "type": "array",
77 "items": {
78 "type": "string"
79 }
74 } 80 }
75 } 81 }
76} 82}