diff options
author | Joel Challis <[email protected]> | 2024-06-18 03:44:22 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-06-18 03:44:22 +0100 |
commit | 53a0cdc4467fb688faa2708fe75daa26686e918d (patch) | |
tree | 0a1fb6640478bf29ca2baaf1003fb0fcc78f8cc1 /data | |
parent | 938badc3b0a8b71647e2463241f2e3fe8578f32a (diff) | |
download | qmk_firmware-53a0cdc4467fb688faa2708fe75daa26686e918d.tar.gz qmk_firmware-53a0cdc4467fb688faa2708fe75daa26686e918d.zip |
Implement data driven joysticks (#22947)
Diffstat (limited to 'data')
-rw-r--r-- | data/mappings/info_config.hjson | 5 | ||||
-rw-r--r-- | data/mappings/info_rules.hjson | 2 | ||||
-rw-r--r-- | data/schemas/keyboard.jsonschema | 30 |
3 files changed, 37 insertions, 0 deletions
diff --git a/data/mappings/info_config.hjson b/data/mappings/info_config.hjson index b61ca04071..4f731b6011 100644 --- a/data/mappings/info_config.hjson +++ b/data/mappings/info_config.hjson @@ -72,6 +72,11 @@ "LED_KANA_PIN": {"info_key": "indicators.kana"}, "LED_PIN_ON_STATE": {"info_key": "indicators.on_state", "value_type": "int"}, + // Joystick + "JOYSTICK_AXIS_COUNT": {"info_key": "joystick.axis_count", "value_type": "int"}, + "JOYSTICK_AXIS_RESOLUTION": {"info_key": "joystick.axis_resolution", "value_type": "int"}, + "JOYSTICK_BUTTON_COUNT": {"info_key": "joystick.button_count", "value_type": "int"}, + // Leader Key "LEADER_PER_KEY_TIMING": {"info_key": "leader_key.timing", "value_type": "flag"}, "LEADER_KEY_STRICT_KEY_PROCESSING": {"info_key": "leader_key.strict_processing", "value_type": "flag"}, diff --git a/data/mappings/info_rules.hjson b/data/mappings/info_rules.hjson index 384bc87b78..64972af63b 100644 --- a/data/mappings/info_rules.hjson +++ b/data/mappings/info_rules.hjson @@ -25,6 +25,8 @@ "ENCODER_DRIVER": {"info_key": "encoder.driver"}, "FIRMWARE_FORMAT": {"info_key": "build.firmware_format"}, "HAPTIC_DRIVER": {"info_key": "haptic.driver"}, + "JOYSTICK_DRIVER": {"info_key": "joystick.driver"}, + "JOYSTICK_ENABLE": {"info_key": "joystick.enabled", "value_type": "bool"}, "KEYBOARD_SHARED_EP": {"info_key": "usb.shared_endpoint.keyboard", "value_type": "bool"}, "LAYOUTS": {"info_key": "community_layouts", "value_type": "list"}, "LED_MATRIX_DRIVER": {"info_key": "led_matrix.driver"}, diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index 5b63acf8e8..e758c325c7 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -342,6 +342,36 @@ "on_state": {"$ref": "qmk.definitions.v1#/bit"} } }, + "joystick": { + "type": "object", + "properties": { + "enabled": {"type": "boolean"}, + "driver": {"type": "string"}, + "button_count": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "axis_resolution": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "axes": { + "type": "object", + "propertyNames": {"enum": ["x", "y", "z", "rx", "ry", "rz"]} + "additionalProperties": { + "oneOf": [ + { + "type": "object", + "properties": { + "input_pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "low": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "rest": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "high": {"$ref": "qmk.definitions.v1#/unsigned_int"} + } + }, + { + "type": "string", + "enum": ["virtual"] + } + ] + } + } + } + }, "keycodes": {"$ref": "qmk.definitions.v1#/keycode_decl_array"}, "layout_aliases": { "type": "object", |