diff --git a/zmk_studio_cli/commands/__init__.py b/zmk_studio_cli/commands/__init__.py index a66b2f4..581a6c5 100644 --- a/zmk_studio_cli/commands/__init__.py +++ b/zmk_studio_cli/commands/__init__.py @@ -7,7 +7,7 @@ import typer -from . import behaviors, core, keymap +from . import behaviors, combos, core, keymap def register(app: typer.Typer) -> None: @@ -15,3 +15,4 @@ def register(app: typer.Typer) -> None: app.add_typer(core.app) app.add_typer(behaviors.app) app.add_typer(keymap.app) + app.add_typer(combos.app) diff --git a/zmk_studio_cli/commands/combos/__init__.py b/zmk_studio_cli/commands/combos/__init__.py new file mode 100644 index 0000000..279a0e3 --- /dev/null +++ b/zmk_studio_cli/commands/combos/__init__.py @@ -0,0 +1,39 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +""" +ZMK Studio CLI combos subcommands. +""" + +import typer + +from .get_combos import combos_get_combos +from .add_combo import combos_add_combo +from .delete_combo import combos_delete_combo +from .set_binding import combos_set_binding +from .add_position import combos_add_position +from .remove_position import combos_remove_position +from .add_layer import combos_add_layer +from .remove_layer import combos_remove_layer +from .clear_layers import combos_clear_layers +from .set_slow_release import combos_set_slow_release +from .set_timeout import combos_set_timeout +from .set_req_prior_idle import combos_set_req_prior_idle + +app = typer.Typer(name="combos") +app.command(name="get-combos")(combos_get_combos) +app.command(name="add-combo")(combos_add_combo) +app.command(name="delete-combo")(combos_delete_combo) +app.command(name="set-binding")(combos_set_binding) +app.command(name="add-position")(combos_add_position) +app.command(name="remove-position")(combos_remove_position) +app.command(name="add-layer")(combos_add_layer) +app.command(name="remove-layer")(combos_remove_layer) +app.command(name="clear-layers")(combos_clear_layers) +app.command(name="set-slow-release")(combos_set_slow_release) +app.command(name="set-timeout")(combos_set_timeout) +app.command(name="set-req-prior-idle")(combos_set_req_prior_idle) + +@app.callback() +def combos() -> None: + """ZMK Studio combos actions""" diff --git a/zmk_studio_cli/commands/combos/add_combo.py b/zmk_studio_cli/commands/combos/add_combo.py new file mode 100644 index 0000000..c81b3ef --- /dev/null +++ b/zmk_studio_cli/commands/combos/add_combo.py @@ -0,0 +1,65 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +""" +add-combo +""" + +from typing import Annotated + +import typer + +from ...proto import studio_pb2 as studio +from ...rpc import rpc_get_response, rpc_handle_response, rpc_send_request + + +def combos_add_combo( + ctx: typer.Context, + behavior_id: Annotated[ + int, + typer.Argument( + help="Behavior ID", + ), + ] = None, + param1: Annotated[ + int, + typer.Argument( + help="Behavior 1st parameter", + ), + ] = None, + param2: Annotated[ + int, + typer.Argument( + help="Behavior 1st parameter", + ), + ] = None, + key_position1: Annotated[ + int, + typer.Argument( + help="Key position #1", + ), + ] = None, + key_position2: Annotated[ + int, + typer.Argument( + help="Key position #1", + ), + ] = None, +) -> None: + """Add a combo""" + ser = ctx.obj.ser + verbose = ctx.obj.verbose + + request = studio.Request() + request.request_id = 1 + request.combos.add_combo.binding.behavior_id = behavior_id + if param1: + request.combos.add_combo.binding.param1 = param1 + if param2: + request.combos.add_combo.binding.param2 = param2 + + request.combos.add_combo.positions.append(key_position1) + request.combos.add_combo.positions.append(key_position2) + + rpc_send_request(ser=ser, request=request, verbose=verbose) + rpc_handle_response(rpc_get_response(ser=ser, verbose=verbose)) diff --git a/zmk_studio_cli/commands/combos/add_layer.py b/zmk_studio_cli/commands/combos/add_layer.py new file mode 100644 index 0000000..ddf37cb --- /dev/null +++ b/zmk_studio_cli/commands/combos/add_layer.py @@ -0,0 +1,42 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +""" +add-layer +""" + +from typing import Annotated + +import typer + +from ...proto import studio_pb2 as studio +from ...rpc import rpc_get_response, rpc_handle_response, rpc_send_request + + +def combos_add_layer( + ctx: typer.Context, + combo_id: Annotated[ + int, + typer.Argument( + help="Combo identifier", + ), + ] = None, + layer: Annotated[ + int, + typer.Argument( + help="Layer", + ), + ] = None, +) -> None: + """Remove layer from a combo""" + ser = ctx.obj.ser + verbose = ctx.obj.verbose + + request = studio.Request() + request.request_id = 1 + request.combos.set_combo_layer_state.id = combo_id + request.combos.set_combo_layer_state.layer = layer + request.combos.set_combo_layer_state.enabled = True + + rpc_send_request(ser=ser, request=request, verbose=verbose) + rpc_handle_response(rpc_get_response(ser=ser, verbose=verbose)) diff --git a/zmk_studio_cli/commands/combos/add_position.py b/zmk_studio_cli/commands/combos/add_position.py new file mode 100644 index 0000000..665276c --- /dev/null +++ b/zmk_studio_cli/commands/combos/add_position.py @@ -0,0 +1,44 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +""" +add-position +""" + +from typing import Annotated + +import typer + +from ...proto import studio_pb2 as studio +from ...rpc import rpc_get_response, rpc_handle_response, rpc_send_request + + +def combos_add_position( + ctx: typer.Context, + combo_id: Annotated[ + int | None, + typer.Argument( + help="Combo identifier", + ), + ] = None, + key_pos: Annotated[ + int | None, + typer.Argument( + help="Key Position", + ), + ] = None, +) -> None: + """Add key position to a combo""" + ser = ctx.obj.ser + verbose = ctx.obj.verbose + + request = studio.Request() + request.request_id = 1 + request.combos.set_combo_position_state.id = combo_id + request.combos.set_combo_position_state.position = key_pos + request.combos.set_combo_position_state.enabled = True + + rpc_send_request(ser=ser, request=request, verbose=verbose) + rpc_handle_response(rpc_get_response(ser=ser, verbose=verbose)) + + diff --git a/zmk_studio_cli/commands/combos/clear_layers.py b/zmk_studio_cli/commands/combos/clear_layers.py new file mode 100644 index 0000000..8d7985a --- /dev/null +++ b/zmk_studio_cli/commands/combos/clear_layers.py @@ -0,0 +1,34 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +""" +clear-layers +""" + +from typing import Annotated + +import typer + +from ...proto import studio_pb2 as studio +from ...rpc import rpc_get_response, rpc_handle_response, rpc_send_request + + +def combos_clear_layers( + ctx: typer.Context, + combo_id: Annotated[ + int, + typer.Argument( + help="Combo identifier", + ), + ] = None, +) -> None: + """Clear layers from a combo""" + ser = ctx.obj.ser + verbose = ctx.obj.verbose + + request = studio.Request() + request.request_id = 1 + request.combos.clear_combo_layers.id = combo_id + + rpc_send_request(ser=ser, request=request, verbose=verbose) + rpc_handle_response(rpc_get_response(ser=ser, verbose=verbose)) diff --git a/zmk_studio_cli/commands/combos/delete_combo.py b/zmk_studio_cli/commands/combos/delete_combo.py new file mode 100644 index 0000000..58a2603 --- /dev/null +++ b/zmk_studio_cli/commands/combos/delete_combo.py @@ -0,0 +1,33 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +""" +delete-combo +""" + +from typing import Annotated + +import typer + +from ...proto import studio_pb2 as studio +from ...rpc import rpc_get_response, rpc_handle_response, rpc_send_request + +def combos_delete_combo( + ctx: typer.Context, + combo_id: Annotated[ + int | None, + typer.Argument( + help="Combo identifier", + ), + ] = None, +) -> None: + """Delete combo by identifier""" + ser = ctx.obj.ser + verbose = ctx.obj.verbose + + request = studio.Request() + request.request_id = 1 + request.combos.delete_combo.id = combo_id + + rpc_send_request(ser=ser, request=request, verbose=verbose) + rpc_handle_response(rpc_get_response(ser=ser, verbose=verbose)) diff --git a/zmk_studio_cli/commands/combos/get_combos.py b/zmk_studio_cli/commands/combos/get_combos.py new file mode 100644 index 0000000..5ad04e2 --- /dev/null +++ b/zmk_studio_cli/commands/combos/get_combos.py @@ -0,0 +1,24 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +""" +get-combos +""" + +import typer + +from ...proto import studio_pb2 as studio +from ...rpc import rpc_get_response, rpc_handle_response, rpc_send_request + + +def combos_get_combos(ctx: typer.Context) -> None: + """Get Combos""" + ser = ctx.obj.ser + verbose = ctx.obj.verbose + + request = studio.Request() + request.request_id = 1 + request.combos.get_combos = True + + rpc_send_request(ser=ser, request=request, verbose=verbose) + rpc_handle_response(rpc_get_response(ser=ser, verbose=verbose)) diff --git a/zmk_studio_cli/commands/combos/remove_layer.py b/zmk_studio_cli/commands/combos/remove_layer.py new file mode 100644 index 0000000..2369f54 --- /dev/null +++ b/zmk_studio_cli/commands/combos/remove_layer.py @@ -0,0 +1,42 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +""" +remove-layer +""" + +from typing import Annotated + +import typer + +from ...proto import studio_pb2 as studio +from ...rpc import rpc_get_response, rpc_handle_response, rpc_send_request + + +def combos_remove_layer( + ctx: typer.Context, + combo_id: Annotated[ + int, + typer.Argument( + help="Combo identifier", + ), + ] = None, + layer: Annotated[ + int, + typer.Argument( + help="Layer", + ), + ] = None, +) -> None: + """Remove layer from a combo""" + ser = ctx.obj.ser + verbose = ctx.obj.verbose + + request = studio.Request() + request.request_id = 1 + request.combos.set_combo_layer_state.id = combo_id + request.combos.set_combo_layer_state.layer = layer + request.combos.set_combo_layer_state.enabled = False + + rpc_send_request(ser=ser, request=request, verbose=verbose) + rpc_handle_response(rpc_get_response(ser=ser, verbose=verbose)) diff --git a/zmk_studio_cli/commands/combos/remove_position.py b/zmk_studio_cli/commands/combos/remove_position.py new file mode 100644 index 0000000..bb305cf --- /dev/null +++ b/zmk_studio_cli/commands/combos/remove_position.py @@ -0,0 +1,42 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +""" +remove-position +""" + +from typing import Annotated + +import typer + +from ...proto import studio_pb2 as studio +from ...rpc import rpc_get_response, rpc_handle_response, rpc_send_request + + +def combos_remove_position( + ctx: typer.Context, + combo_id: Annotated[ + int, + typer.Argument( + help="Combo identifier", + ), + ] = None, + key_pos: Annotated[ + int, + typer.Argument( + help="Key Position", + ), + ] = None, +) -> None: + """Remove key position from a combo""" + ser = ctx.obj.ser + verbose = ctx.obj.verbose + + request = studio.Request() + request.request_id = 1 + request.combos.set_combo_position_state.id = combo_id + request.combos.set_combo_position_state.position = key_pos + request.combos.set_combo_position_state.enabled = False + + rpc_send_request(ser=ser, request=request, verbose=verbose) + rpc_handle_response(rpc_get_response(ser=ser, verbose=verbose)) diff --git a/zmk_studio_cli/commands/combos/set_binding.py b/zmk_studio_cli/commands/combos/set_binding.py new file mode 100644 index 0000000..686eddb --- /dev/null +++ b/zmk_studio_cli/commands/combos/set_binding.py @@ -0,0 +1,57 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +""" +set-binding +""" + +from typing import Annotated + +import typer + +from ...proto import studio_pb2 as studio +from ...rpc import rpc_get_response, rpc_handle_response, rpc_send_request + + +def combos_set_binding( + ctx: typer.Context, + combo_id: Annotated[ + int, + typer.Argument( + help="Combo identifier", + ), + ] = None, + behavior_id: Annotated[ + int, + typer.Argument( + help="Behavior ID", + ), + ] = None, + param1: Annotated[ + int | None, + typer.Argument( + help="Behavior 1st parameter", + ), + ] = None, + param2: Annotated[ + int | None, + typer.Argument( + help="Behavior 1st parameter", + ), + ] = None, +) -> None: + """Set a combo's binding""" + ser = ctx.obj.ser + verbose = ctx.obj.verbose + + request = studio.Request() + request.request_id = 1 + request.combos.set_combo_binding.id = combo_id + request.combos.set_combo_binding.binding.behavior_id = behavior_id + if param1: + request.combos.set_combo_binding.binding.param1 = param1 + if param2: + request.combos.set_combo_binding.binding.param2 = param2 + + rpc_send_request(ser=ser, request=request, verbose=verbose) + rpc_handle_response(rpc_get_response(ser=ser, verbose=verbose)) diff --git a/zmk_studio_cli/commands/combos/set_req_prior_idle.py b/zmk_studio_cli/commands/combos/set_req_prior_idle.py new file mode 100644 index 0000000..fe93b44 --- /dev/null +++ b/zmk_studio_cli/commands/combos/set_req_prior_idle.py @@ -0,0 +1,41 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +""" +set-req-prior-idle +""" + +from typing import Annotated + +import typer + +from ...proto import studio_pb2 as studio +from ...rpc import rpc_get_response, rpc_handle_response, rpc_send_request + + +def combos_set_req_prior_idle( + ctx: typer.Context, + combo_id: Annotated[ + int, + typer.Argument( + help="Combo identifier", + ), + ] = None, + req_prior_idle: Annotated[ + int, + typer.Argument( + help="Require prior idle (ms)", + ), + ] = None, +) -> None: + """Set combo timeout""" + ser = ctx.obj.ser + verbose = ctx.obj.verbose + + request = studio.Request() + request.request_id = 1 + request.combos.set_combo_require_prior_idle.id = combo_id + request.combos.set_combo_require_prior_idle.require_prior_idle = req_prior_idle + + rpc_send_request(ser=ser, request=request, verbose=verbose) + rpc_handle_response(rpc_get_response(ser=ser, verbose=verbose)) diff --git a/zmk_studio_cli/commands/combos/set_slow_release.py b/zmk_studio_cli/commands/combos/set_slow_release.py new file mode 100644 index 0000000..df83ef3 --- /dev/null +++ b/zmk_studio_cli/commands/combos/set_slow_release.py @@ -0,0 +1,41 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +""" +set-slow-release +""" + +from typing import Annotated + +import typer + +from ...proto import studio_pb2 as studio +from ...rpc import rpc_get_response, rpc_handle_response, rpc_send_request + + +def combos_set_slow_release( + ctx: typer.Context, + combo_id: Annotated[ + int, + typer.Argument( + help="Combo identifier", + ), + ] = None, + enabled: Annotated[ + bool, + typer.Argument( + help="Enabled/disabled", + ), + ] = None, +) -> None: + """Set/unset combo slow-release""" + ser = ctx.obj.ser + verbose = ctx.obj.verbose + + request = studio.Request() + request.request_id = 1 + request.combos.set_combo_slow_release_state.id = combo_id + request.combos.set_combo_slow_release_state.enabled = enabled + + rpc_send_request(ser=ser, request=request, verbose=verbose) + rpc_handle_response(rpc_get_response(ser=ser, verbose=verbose)) diff --git a/zmk_studio_cli/commands/combos/set_timeout.py b/zmk_studio_cli/commands/combos/set_timeout.py new file mode 100644 index 0000000..578b4c2 --- /dev/null +++ b/zmk_studio_cli/commands/combos/set_timeout.py @@ -0,0 +1,41 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +""" +set-timeout +""" + +from typing import Annotated + +import typer + +from ...proto import studio_pb2 as studio +from ...rpc import rpc_get_response, rpc_handle_response, rpc_send_request + + +def combos_set_timeout( + ctx: typer.Context, + combo_id: Annotated[ + int, + typer.Argument( + help="Combo identifier", + ), + ] = None, + timeout: Annotated[ + int, + typer.Argument( + help="Timeout", + ), + ] = None, +) -> None: + """Set combo timeout""" + ser = ctx.obj.ser + verbose = ctx.obj.verbose + + request = studio.Request() + request.request_id = 1 + request.combos.set_combo_timeout.id = combo_id + request.combos.set_combo_timeout.timeout = timeout + + rpc_send_request(ser=ser, request=request, verbose=verbose) + rpc_handle_response(rpc_get_response(ser=ser, verbose=verbose)) diff --git a/zmk_studio_cli/commands/core/__init__.py b/zmk_studio_cli/commands/core/__init__.py index 84ae449..a1b5760 100644 --- a/zmk_studio_cli/commands/core/__init__.py +++ b/zmk_studio_cli/commands/core/__init__.py @@ -11,12 +11,18 @@ from .get_lock_state import core_get_lock_state from .lock import core_lock from .reset_settings import core_reset_settings +from .check_unsaved_changes import core_check_unsaved_changes +from .save_changes import core_save_changes +from .discard_changes import core_discard_changes app = typer.Typer(name="core") app.command(name="get-device-info")(core_get_device_info) app.command(name="get-lock-state")(core_get_lock_state) app.command(name="lock")(core_lock) app.command(name="reset-settings")(core_reset_settings) +app.command(name="check-unsaved-changes")(core_check_unsaved_changes) +app.command(name="save-changes")(core_save_changes) +app.command(name="discard-changes")(core_discard_changes) @app.callback() diff --git a/zmk_studio_cli/commands/core/check_unsaved_changes.py b/zmk_studio_cli/commands/core/check_unsaved_changes.py new file mode 100644 index 0000000..ed22bc6 --- /dev/null +++ b/zmk_studio_cli/commands/core/check_unsaved_changes.py @@ -0,0 +1,23 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +""" +check-unsaved-changes +""" + +import typer + +from ...proto import studio_pb2 as studio +from ...rpc import rpc_get_response, rpc_handle_response, rpc_send_request + + +def core_check_unsaved_changes(ctx: typer.Context) -> None: + """Check if there are unsaved changes on the device""" + ser = ctx.obj.ser + verbose = ctx.obj.verbose + + request = studio.Request() + request.request_id = 2 + request.core.check_unsaved_changes = True + rpc_send_request(ser=ser, request=request, verbose=verbose) + rpc_handle_response(rpc_get_response(ser=ser, verbose=verbose)) diff --git a/zmk_studio_cli/commands/core/discard_changes.py b/zmk_studio_cli/commands/core/discard_changes.py new file mode 100644 index 0000000..b1db042 --- /dev/null +++ b/zmk_studio_cli/commands/core/discard_changes.py @@ -0,0 +1,23 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +""" +discard-changes +""" + +import typer + +from ...proto import studio_pb2 as studio +from ...rpc import rpc_get_response, rpc_handle_response, rpc_send_request + + +def core_discard_changes(ctx: typer.Context) -> None: + """Discard unsaved changes on the device""" + ser = ctx.obj.ser + verbose = ctx.obj.verbose + + request = studio.Request() + request.request_id = 2 + request.core.discard_changes = True + rpc_send_request(ser=ser, request=request, verbose=verbose) + rpc_handle_response(rpc_get_response(ser=ser, verbose=verbose)) diff --git a/zmk_studio_cli/commands/core/save_changes.py b/zmk_studio_cli/commands/core/save_changes.py new file mode 100644 index 0000000..cfd8754 --- /dev/null +++ b/zmk_studio_cli/commands/core/save_changes.py @@ -0,0 +1,23 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +""" +save-changes +""" + +import typer + +from ...proto import studio_pb2 as studio +from ...rpc import rpc_get_response, rpc_handle_response, rpc_send_request + + +def core_save_changes(ctx: typer.Context) -> None: + """Save all unsaved changes on the device""" + ser = ctx.obj.ser + verbose = ctx.obj.verbose + + request = studio.Request() + request.request_id = 2 + request.core.save_changes = True + rpc_send_request(ser=ser, request=request, verbose=verbose) + rpc_handle_response(rpc_get_response(ser=ser, verbose=verbose)) diff --git a/zmk_studio_cli/proto/behaviors_pb2.py b/zmk_studio_cli/proto/behaviors_pb2.py index 770edba..61b48a7 100644 --- a/zmk_studio_cli/proto/behaviors_pb2.py +++ b/zmk_studio_cli/proto/behaviors_pb2.py @@ -2,51 +2,55 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: behaviors.proto -# Protobuf Python Version: 6.33.0 +# Protobuf Python Version: 6.31.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder - _runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, 6, 33, 0, "", "behaviors.proto" + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'behaviors.proto' ) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x0f\x62\x65haviors.proto\x12\rzmk.behaviors"\x81\x01\n\x07Request\x12\x1c\n\x12list_all_behaviors\x18\x01 \x01(\x08H\x00\x12H\n\x14get_behavior_details\x18\x02 \x01(\x0b\x32(.zmk.behaviors.GetBehaviorDetailsRequestH\x00\x42\x0e\n\x0crequest_type"0\n\x19GetBehaviorDetailsRequest\x12\x13\n\x0b\x62\x65havior_id\x18\x01 \x01(\r"\xad\x01\n\x08Response\x12\x45\n\x12list_all_behaviors\x18\x01 \x01(\x0b\x32\'.zmk.behaviors.ListAllBehaviorsResponseH\x00\x12I\n\x14get_behavior_details\x18\x02 \x01(\x0b\x32).zmk.behaviors.GetBehaviorDetailsResponseH\x00\x42\x0f\n\rresponse_type"-\n\x18ListAllBehaviorsResponse\x12\x11\n\tbehaviors\x18\x01 \x03(\r"}\n\x1aGetBehaviorDetailsResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12=\n\x08metadata\x18\x03 \x03(\x0b\x32+.zmk.behaviors.BehaviorBindingParametersSet"\xa2\x01\n\x1c\x42\x65haviorBindingParametersSet\x12@\n\x06param1\x18\x01 \x03(\x0b\x32\x30.zmk.behaviors.BehaviorParameterValueDescription\x12@\n\x06param2\x18\x02 \x03(\x0b\x32\x30.zmk.behaviors.BehaviorParameterValueDescription"B\n&BehaviorParameterValueDescriptionRange\x12\x0b\n\x03min\x18\x01 \x01(\x05\x12\x0b\n\x03max\x18\x02 \x01(\x05"\x16\n\x14\x42\x65haviorParameterNil"\x1a\n\x18\x42\x65haviorParameterLayerId"G\n\x19\x42\x65haviorParameterHidUsage\x12\x14\n\x0ckeyboard_max\x18\x01 \x01(\r\x12\x14\n\x0c\x63onsumer_max\x18\x02 \x01(\r"\xcb\x02\n!BehaviorParameterValueDescription\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x32\n\x03nil\x18\x02 \x01(\x0b\x32#.zmk.behaviors.BehaviorParameterNilH\x00\x12\x12\n\x08\x63onstant\x18\x03 \x01(\rH\x00\x12\x46\n\x05range\x18\x04 \x01(\x0b\x32\x35.zmk.behaviors.BehaviorParameterValueDescriptionRangeH\x00\x12=\n\thid_usage\x18\x05 \x01(\x0b\x32(.zmk.behaviors.BehaviorParameterHidUsageH\x00\x12;\n\x08layer_id\x18\x06 \x01(\x0b\x32\'.zmk.behaviors.BehaviorParameterLayerIdH\x00\x42\x0c\n\nvalue_typeb\x06proto3' -) + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0f\x62\x65haviors.proto\x12\rzmk.behaviors\"\x81\x01\n\x07Request\x12\x1c\n\x12list_all_behaviors\x18\x01 \x01(\x08H\x00\x12H\n\x14get_behavior_details\x18\x02 \x01(\x0b\x32(.zmk.behaviors.GetBehaviorDetailsRequestH\x00\x42\x0e\n\x0crequest_type\"0\n\x19GetBehaviorDetailsRequest\x12\x13\n\x0b\x62\x65havior_id\x18\x01 \x01(\r\"\xad\x01\n\x08Response\x12\x45\n\x12list_all_behaviors\x18\x01 \x01(\x0b\x32\'.zmk.behaviors.ListAllBehaviorsResponseH\x00\x12I\n\x14get_behavior_details\x18\x02 \x01(\x0b\x32).zmk.behaviors.GetBehaviorDetailsResponseH\x00\x42\x0f\n\rresponse_type\"-\n\x18ListAllBehaviorsResponse\x12\x11\n\tbehaviors\x18\x01 \x03(\r\"}\n\x1aGetBehaviorDetailsResponse\x12\n\n\x02id\x18\x01 \x01(\r\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12=\n\x08metadata\x18\x03 \x03(\x0b\x32+.zmk.behaviors.BehaviorBindingParametersSet\"\xa2\x01\n\x1c\x42\x65haviorBindingParametersSet\x12@\n\x06param1\x18\x01 \x03(\x0b\x32\x30.zmk.behaviors.BehaviorParameterValueDescription\x12@\n\x06param2\x18\x02 \x03(\x0b\x32\x30.zmk.behaviors.BehaviorParameterValueDescription\"B\n&BehaviorParameterValueDescriptionRange\x12\x0b\n\x03min\x18\x01 \x01(\x05\x12\x0b\n\x03max\x18\x02 \x01(\x05\"\x16\n\x14\x42\x65haviorParameterNil\"\x1a\n\x18\x42\x65haviorParameterLayerId\"G\n\x19\x42\x65haviorParameterHidUsage\x12\x14\n\x0ckeyboard_max\x18\x01 \x01(\r\x12\x14\n\x0c\x63onsumer_max\x18\x02 \x01(\r\"\xcb\x02\n!BehaviorParameterValueDescription\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x32\n\x03nil\x18\x02 \x01(\x0b\x32#.zmk.behaviors.BehaviorParameterNilH\x00\x12\x12\n\x08\x63onstant\x18\x03 \x01(\rH\x00\x12\x46\n\x05range\x18\x04 \x01(\x0b\x32\x35.zmk.behaviors.BehaviorParameterValueDescriptionRangeH\x00\x12=\n\thid_usage\x18\x05 \x01(\x0b\x32(.zmk.behaviors.BehaviorParameterHidUsageH\x00\x12;\n\x08layer_id\x18\x06 \x01(\x0b\x32\'.zmk.behaviors.BehaviorParameterLayerIdH\x00\x42\x0c\n\nvalue_typeb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "behaviors_pb2", _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'behaviors_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: - DESCRIPTOR._loaded_options = None - _globals["_REQUEST"]._serialized_start = 35 - _globals["_REQUEST"]._serialized_end = 164 - _globals["_GETBEHAVIORDETAILSREQUEST"]._serialized_start = 166 - _globals["_GETBEHAVIORDETAILSREQUEST"]._serialized_end = 214 - _globals["_RESPONSE"]._serialized_start = 217 - _globals["_RESPONSE"]._serialized_end = 390 - _globals["_LISTALLBEHAVIORSRESPONSE"]._serialized_start = 392 - _globals["_LISTALLBEHAVIORSRESPONSE"]._serialized_end = 437 - _globals["_GETBEHAVIORDETAILSRESPONSE"]._serialized_start = 439 - _globals["_GETBEHAVIORDETAILSRESPONSE"]._serialized_end = 564 - _globals["_BEHAVIORBINDINGPARAMETERSSET"]._serialized_start = 567 - _globals["_BEHAVIORBINDINGPARAMETERSSET"]._serialized_end = 729 - _globals["_BEHAVIORPARAMETERVALUEDESCRIPTIONRANGE"]._serialized_start = 731 - _globals["_BEHAVIORPARAMETERVALUEDESCRIPTIONRANGE"]._serialized_end = 797 - _globals["_BEHAVIORPARAMETERNIL"]._serialized_start = 799 - _globals["_BEHAVIORPARAMETERNIL"]._serialized_end = 821 - _globals["_BEHAVIORPARAMETERLAYERID"]._serialized_start = 823 - _globals["_BEHAVIORPARAMETERLAYERID"]._serialized_end = 849 - _globals["_BEHAVIORPARAMETERHIDUSAGE"]._serialized_start = 851 - _globals["_BEHAVIORPARAMETERHIDUSAGE"]._serialized_end = 922 - _globals["_BEHAVIORPARAMETERVALUEDESCRIPTION"]._serialized_start = 925 - _globals["_BEHAVIORPARAMETERVALUEDESCRIPTION"]._serialized_end = 1256 + DESCRIPTOR._loaded_options = None + _globals['_REQUEST']._serialized_start=35 + _globals['_REQUEST']._serialized_end=164 + _globals['_GETBEHAVIORDETAILSREQUEST']._serialized_start=166 + _globals['_GETBEHAVIORDETAILSREQUEST']._serialized_end=214 + _globals['_RESPONSE']._serialized_start=217 + _globals['_RESPONSE']._serialized_end=390 + _globals['_LISTALLBEHAVIORSRESPONSE']._serialized_start=392 + _globals['_LISTALLBEHAVIORSRESPONSE']._serialized_end=437 + _globals['_GETBEHAVIORDETAILSRESPONSE']._serialized_start=439 + _globals['_GETBEHAVIORDETAILSRESPONSE']._serialized_end=564 + _globals['_BEHAVIORBINDINGPARAMETERSSET']._serialized_start=567 + _globals['_BEHAVIORBINDINGPARAMETERSSET']._serialized_end=729 + _globals['_BEHAVIORPARAMETERVALUEDESCRIPTIONRANGE']._serialized_start=731 + _globals['_BEHAVIORPARAMETERVALUEDESCRIPTIONRANGE']._serialized_end=797 + _globals['_BEHAVIORPARAMETERNIL']._serialized_start=799 + _globals['_BEHAVIORPARAMETERNIL']._serialized_end=821 + _globals['_BEHAVIORPARAMETERLAYERID']._serialized_start=823 + _globals['_BEHAVIORPARAMETERLAYERID']._serialized_end=849 + _globals['_BEHAVIORPARAMETERHIDUSAGE']._serialized_start=851 + _globals['_BEHAVIORPARAMETERHIDUSAGE']._serialized_end=922 + _globals['_BEHAVIORPARAMETERVALUEDESCRIPTION']._serialized_start=925 + _globals['_BEHAVIORPARAMETERVALUEDESCRIPTION']._serialized_end=1256 # @@protoc_insertion_point(module_scope) diff --git a/zmk_studio_cli/proto/combos_pb2.py b/zmk_studio_cli/proto/combos_pb2.py new file mode 100644 index 0000000..2e8c964 --- /dev/null +++ b/zmk_studio_cli/proto/combos_pb2.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: combos.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'combos.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import keymap_pb2 as keymap__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x63ombos.proto\x12\nzmk.combos\x1a\x0ckeymap.proto\"\xf0\x04\n\x07Request\x12\x14\n\nget_combos\x18\x01 \x01(\x08H\x00\x12\x30\n\tadd_combo\x18\x02 \x01(\x0b\x32\x1b.zmk.combos.AddComboRequestH\x00\x12\x32\n\x0c\x64\x65lete_combo\x18\x03 \x01(\x0b\x32\x1a.zmk.combos.ComboIdRequestH\x00\x12\x44\n\x18set_combo_position_state\x18\x04 \x01(\x0b\x32 .zmk.combos.ComboPositionRequestH\x00\x12\x38\n\x12\x63lear_combo_layers\x18\x05 \x01(\x0b\x32\x1a.zmk.combos.ComboIdRequestH\x00\x12>\n\x15set_combo_layer_state\x18\x06 \x01(\x0b\x32\x1d.zmk.combos.ComboLayerRequestH\x00\x12K\n\x1cset_combo_slow_release_state\x18\x07 \x01(\x0b\x32#.zmk.combos.ComboSlowReleaseRequestH\x00\x12<\n\x11set_combo_timeout\x18\x08 \x01(\x0b\x32\x1f.zmk.combos.ComboTimeoutRequestH\x00\x12P\n\x1cset_combo_require_prior_idle\x18\t \x01(\x0b\x32(.zmk.combos.ComboRequirePriorIdleRequestH\x00\x12<\n\x11set_combo_binding\x18\n \x01(\x0b\x32\x1f.zmk.combos.ComboBindingRequestH\x00\x42\x0e\n\x0crequest_type\"\x90\x05\n\x08Response\x12\x33\n\nget_combos\x18\x01 \x01(\x0b\x32\x1d.zmk.combos.GetCombosResponseH\x00\x12\x31\n\tadd_combo\x18\x02 \x01(\x0b\x32\x1c.zmk.combos.AddComboResponseH\x00\x12\x37\n\x0c\x64\x65lete_combo\x18\x03 \x01(\x0b\x32\x1f.zmk.combos.DeleteComboResponseH\x00\x12\x43\n\x18set_combo_position_state\x18\x04 \x01(\x0b\x32\x1f.zmk.combos.ComboChangeResponseH\x00\x12=\n\x12\x63lear_combo_layers\x18\x05 \x01(\x0b\x32\x1f.zmk.combos.ComboChangeResponseH\x00\x12@\n\x15set_combo_layer_state\x18\x06 \x01(\x0b\x32\x1f.zmk.combos.ComboChangeResponseH\x00\x12G\n\x1cset_combo_slow_release_state\x18\x07 \x01(\x0b\x32\x1f.zmk.combos.ComboChangeResponseH\x00\x12<\n\x11set_combo_timeout\x18\x08 \x01(\x0b\x32\x1f.zmk.combos.ComboChangeResponseH\x00\x12G\n\x1cset_combo_require_prior_idle\x18\t \x01(\x0b\x32\x1f.zmk.combos.ComboChangeResponseH\x00\x12<\n\x11set_combo_binding\x18\n \x01(\x0b\x32\x1f.zmk.combos.ComboChangeResponseH\x00\x42\x0f\n\rresponse_type\"M\n\x0cNotification\x12(\n\x1eunsaved_changes_status_changed\x18\x01 \x01(\x08H\x00\x42\x13\n\x11notification_type\"\xb1\x01\n\x05\x43ombo\x12\n\n\x02id\x18\x01 \x01(\r\x12\x11\n\tpositions\x18\x02 \x03(\r\x12,\n\x07\x62inding\x18\x03 \x01(\x0b\x32\x1b.zmk.keymap.BehaviorBinding\x12\x12\n\ntimeout_ms\x18\x04 \x01(\r\x12\x1d\n\x15require_prior_idle_ms\x18\x05 \x01(\r\x12\x12\n\nlayer_mask\x18\x06 \x01(\r\x12\x14\n\x0cslow_release\x18\x07 \x01(\x08\"@\n\x06\x43ombos\x12!\n\x06\x63ombos\x18\x01 \x03(\x0b\x32\x11.zmk.combos.Combo\x12\x13\n\x0b\x66ree_combos\x18\x02 \x01(\r\"j\n\x11GetCombosResponse\x12 \n\x02ok\x18\x01 \x01(\x0b\x32\x12.zmk.combos.CombosH\x00\x12)\n\x03\x65rr\x18\x02 \x01(\x0e\x32\x1a.zmk.combos.ComboErrorCodeH\x00\x42\x08\n\x06result\"\xaf\x01\n\x0f\x41\x64\x64\x43omboRequest\x12\x11\n\tpositions\x18\x01 \x03(\r\x12,\n\x07\x62inding\x18\x02 \x01(\x0b\x32\x1b.zmk.keymap.BehaviorBinding\x12\x12\n\ntimeout_ms\x18\x03 \x01(\r\x12\x1d\n\x15require_prior_idle_ms\x18\x04 \x01(\r\x12\x12\n\nlayer_mask\x18\x05 \x01(\r\x12\x14\n\x0cslow_release\x18\x06 \x01(\x08\"\\\n\x10\x41\x64\x64\x43omboResponse\x12\x13\n\tok_new_id\x18\x01 \x01(\rH\x00\x12)\n\x03\x65rr\x18\x02 \x01(\x0e\x32\x1a.zmk.combos.ComboErrorCodeH\x00\x42\x08\n\x06result\"\x1c\n\x0e\x43omboIdRequest\x12\n\n\x02id\x18\x01 \x01(\r\"X\n\x13\x44\x65leteComboResponse\x12\x0c\n\x02ok\x18\x01 \x01(\x08H\x00\x12)\n\x03\x65rr\x18\x02 \x01(\x0e\x32\x1a.zmk.combos.ComboErrorCodeH\x00\x42\x08\n\x06result\"E\n\x14\x43omboPositionRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x10\n\x08position\x18\x02 \x01(\r\x12\x0f\n\x07\x65nabled\x18\x03 \x01(\x08\"?\n\x11\x43omboLayerRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\r\n\x05layer\x18\x02 \x01(\r\x12\x0f\n\x07\x65nabled\x18\x03 \x01(\x08\"2\n\x13\x43omboTimeoutRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x0f\n\x07timeout\x18\x02 \x01(\r\"F\n\x1c\x43omboRequirePriorIdleRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x1a\n\x12require_prior_idle\x18\x02 \x01(\r\"6\n\x17\x43omboSlowReleaseRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12\x0f\n\x07\x65nabled\x18\x02 \x01(\x08\"O\n\x13\x43omboBindingRequest\x12\n\n\x02id\x18\x01 \x01(\r\x12,\n\x07\x62inding\x18\x02 \x01(\x0b\x32\x1b.zmk.keymap.BehaviorBinding\"X\n\x13\x43omboChangeResponse\x12\x0c\n\x02ok\x18\x01 \x01(\x08H\x00\x12)\n\x03\x65rr\x18\x02 \x01(\x0e\x32\x1a.zmk.combos.ComboErrorCodeH\x00\x42\x08\n\x06result*\xc8\x01\n\x0e\x43omboErrorCode\x12\x17\n\x13\x43OMBO_ERROR_CODE_OK\x10\x00\x12\x1c\n\x18\x43OMBO_ERROR_CODE_GENERIC\x10\x01\x12\"\n\x1e\x43OMBO_ERROR_CODE_NOT_SUPPORTED\x10\x02\x12\x1d\n\x19\x43OMBO_ERROR_CODE_NO_SPACE\x10\x03\x12\x1e\n\x1a\x43OMBO_ERROR_CODE_NOT_FOUND\x10\x04\x12\x1c\n\x18\x43OMBO_ERROR_CODE_INVALID\x10\x05\x62\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'combos_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + DESCRIPTOR._loaded_options = None + _globals['_COMBOERRORCODE']._serialized_start=2641 + _globals['_COMBOERRORCODE']._serialized_end=2841 + _globals['_REQUEST']._serialized_start=43 + _globals['_REQUEST']._serialized_end=667 + _globals['_RESPONSE']._serialized_start=670 + _globals['_RESPONSE']._serialized_end=1326 + _globals['_NOTIFICATION']._serialized_start=1328 + _globals['_NOTIFICATION']._serialized_end=1405 + _globals['_COMBO']._serialized_start=1408 + _globals['_COMBO']._serialized_end=1585 + _globals['_COMBOS']._serialized_start=1587 + _globals['_COMBOS']._serialized_end=1651 + _globals['_GETCOMBOSRESPONSE']._serialized_start=1653 + _globals['_GETCOMBOSRESPONSE']._serialized_end=1759 + _globals['_ADDCOMBOREQUEST']._serialized_start=1762 + _globals['_ADDCOMBOREQUEST']._serialized_end=1937 + _globals['_ADDCOMBORESPONSE']._serialized_start=1939 + _globals['_ADDCOMBORESPONSE']._serialized_end=2031 + _globals['_COMBOIDREQUEST']._serialized_start=2033 + _globals['_COMBOIDREQUEST']._serialized_end=2061 + _globals['_DELETECOMBORESPONSE']._serialized_start=2063 + _globals['_DELETECOMBORESPONSE']._serialized_end=2151 + _globals['_COMBOPOSITIONREQUEST']._serialized_start=2153 + _globals['_COMBOPOSITIONREQUEST']._serialized_end=2222 + _globals['_COMBOLAYERREQUEST']._serialized_start=2224 + _globals['_COMBOLAYERREQUEST']._serialized_end=2287 + _globals['_COMBOTIMEOUTREQUEST']._serialized_start=2289 + _globals['_COMBOTIMEOUTREQUEST']._serialized_end=2339 + _globals['_COMBOREQUIREPRIORIDLEREQUEST']._serialized_start=2341 + _globals['_COMBOREQUIREPRIORIDLEREQUEST']._serialized_end=2411 + _globals['_COMBOSLOWRELEASEREQUEST']._serialized_start=2413 + _globals['_COMBOSLOWRELEASEREQUEST']._serialized_end=2467 + _globals['_COMBOBINDINGREQUEST']._serialized_start=2469 + _globals['_COMBOBINDINGREQUEST']._serialized_end=2548 + _globals['_COMBOCHANGERESPONSE']._serialized_start=2550 + _globals['_COMBOCHANGERESPONSE']._serialized_end=2638 +# @@protoc_insertion_point(module_scope) diff --git a/zmk_studio_cli/proto/core_pb2.py b/zmk_studio_cli/proto/core_pb2.py index 71b13aa..4d2bb3d 100644 --- a/zmk_studio_cli/proto/core_pb2.py +++ b/zmk_studio_cli/proto/core_pb2.py @@ -2,39 +2,47 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: core.proto -# Protobuf Python Version: 6.33.0 +# Protobuf Python Version: 6.31.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder - _runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, 6, 33, 0, "", "core.proto" + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'core.proto' ) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\ncore.proto\x12\x08zmk.core"x\n\x07Request\x12\x19\n\x0fget_device_info\x18\x01 \x01(\x08H\x00\x12\x18\n\x0eget_lock_state\x18\x02 \x01(\x08H\x00\x12\x0e\n\x04lock\x18\x03 \x01(\x08H\x00\x12\x18\n\x0ereset_settings\x18\x04 \x01(\x08H\x00\x42\x0e\n\x0crequest_type"\xa0\x01\n\x08Response\x12:\n\x0fget_device_info\x18\x01 \x01(\x0b\x32\x1f.zmk.core.GetDeviceInfoResponseH\x00\x12-\n\x0eget_lock_state\x18\x02 \x01(\x0e\x32\x13.zmk.core.LockStateH\x00\x12\x18\n\x0ereset_settings\x18\x04 \x01(\x08H\x00\x42\x0f\n\rresponse_type"<\n\x15GetDeviceInfoResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\rserial_number\x18\x02 \x01(\x0c"V\n\x0cNotification\x12\x31\n\x12lock_state_changed\x18\x01 \x01(\x0e\x32\x13.zmk.core.LockStateH\x00\x42\x13\n\x11notification_type*[\n\tLockState\x12%\n!ZMK_STUDIO_CORE_LOCK_STATE_LOCKED\x10\x00\x12\'\n#ZMK_STUDIO_CORE_LOCK_STATE_UNLOCKED\x10\x01\x62\x06proto3' -) + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\ncore.proto\x12\x08zmk.core\"\xcc\x01\n\x07Request\x12\x19\n\x0fget_device_info\x18\x01 \x01(\x08H\x00\x12\x18\n\x0eget_lock_state\x18\x02 \x01(\x08H\x00\x12\x0e\n\x04lock\x18\x03 \x01(\x08H\x00\x12\x18\n\x0ereset_settings\x18\x04 \x01(\x08H\x00\x12\x1f\n\x15\x63heck_unsaved_changes\x18\x05 \x01(\x08H\x00\x12\x16\n\x0csave_changes\x18\x06 \x01(\x08H\x00\x12\x19\n\x0f\x64iscard_changes\x18\x07 \x01(\x08H\x00\x42\x0e\n\x0crequest_type\"\x93\x02\n\x08Response\x12:\n\x0fget_device_info\x18\x01 \x01(\x0b\x32\x1f.zmk.core.GetDeviceInfoResponseH\x00\x12-\n\x0eget_lock_state\x18\x02 \x01(\x0e\x32\x13.zmk.core.LockStateH\x00\x12\x18\n\x0ereset_settings\x18\x04 \x01(\x08H\x00\x12\x1f\n\x15\x63heck_unsaved_changes\x18\x05 \x01(\x08H\x00\x12\x35\n\x0csave_changes\x18\x06 \x01(\x0b\x32\x1d.zmk.core.SaveChangesResponseH\x00\x12\x19\n\x0f\x64iscard_changes\x18\x07 \x01(\x08H\x00\x42\x0f\n\rresponse_type\"<\n\x15GetDeviceInfoResponse\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\rserial_number\x18\x02 \x01(\x0c\"V\n\x0cNotification\x12\x31\n\x12lock_state_changed\x18\x01 \x01(\x0e\x32\x13.zmk.core.LockStateH\x00\x42\x13\n\x11notification_type\"\\\n\x13SaveChangesResponse\x12\x0c\n\x02ok\x18\x01 \x01(\x08H\x00\x12-\n\x03\x65rr\x18\x02 \x01(\x0e\x32\x1e.zmk.core.SaveChangesErrorCodeH\x00\x42\x08\n\x06result*[\n\tLockState\x12%\n!ZMK_STUDIO_CORE_LOCK_STATE_LOCKED\x10\x00\x12\'\n#ZMK_STUDIO_CORE_LOCK_STATE_UNLOCKED\x10\x01*\x90\x01\n\x14SaveChangesErrorCode\x12\x17\n\x13SAVE_CHANGES_ERR_OK\x10\x00\x12\x1c\n\x18SAVE_CHANGES_ERR_GENERIC\x10\x01\x12\"\n\x1eSAVE_CHANGES_ERR_NOT_SUPPORTED\x10\x02\x12\x1d\n\x19SAVE_CHANGES_ERR_NO_SPACE\x10\x03\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "core_pb2", _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'core_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: - DESCRIPTOR._loaded_options = None - _globals["_LOCKSTATE"]._serialized_start = 459 - _globals["_LOCKSTATE"]._serialized_end = 550 - _globals["_REQUEST"]._serialized_start = 24 - _globals["_REQUEST"]._serialized_end = 144 - _globals["_RESPONSE"]._serialized_start = 147 - _globals["_RESPONSE"]._serialized_end = 307 - _globals["_GETDEVICEINFORESPONSE"]._serialized_start = 309 - _globals["_GETDEVICEINFORESPONSE"]._serialized_end = 369 - _globals["_NOTIFICATION"]._serialized_start = 371 - _globals["_NOTIFICATION"]._serialized_end = 457 + DESCRIPTOR._loaded_options = None + _globals['_LOCKSTATE']._serialized_start=753 + _globals['_LOCKSTATE']._serialized_end=844 + _globals['_SAVECHANGESERRORCODE']._serialized_start=847 + _globals['_SAVECHANGESERRORCODE']._serialized_end=991 + _globals['_REQUEST']._serialized_start=25 + _globals['_REQUEST']._serialized_end=229 + _globals['_RESPONSE']._serialized_start=232 + _globals['_RESPONSE']._serialized_end=507 + _globals['_GETDEVICEINFORESPONSE']._serialized_start=509 + _globals['_GETDEVICEINFORESPONSE']._serialized_end=569 + _globals['_NOTIFICATION']._serialized_start=571 + _globals['_NOTIFICATION']._serialized_end=657 + _globals['_SAVECHANGESRESPONSE']._serialized_start=659 + _globals['_SAVECHANGESRESPONSE']._serialized_end=751 # @@protoc_insertion_point(module_scope) diff --git a/zmk_studio_cli/proto/keymap_pb2.py b/zmk_studio_cli/proto/keymap_pb2.py index bf42ad5..b6c113c 100644 --- a/zmk_studio_cli/proto/keymap_pb2.py +++ b/zmk_studio_cli/proto/keymap_pb2.py @@ -2,91 +2,95 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: keymap.proto -# Protobuf Python Version: 6.33.0 +# Protobuf Python Version: 6.31.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder - _runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, 6, 33, 0, "", "keymap.proto" + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'keymap.proto' ) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x0ckeymap.proto\x12\nzmk.keymap"\x9f\x04\n\x07Request\x12\x14\n\nget_keymap\x18\x01 \x01(\x08H\x00\x12?\n\x11set_layer_binding\x18\x02 \x01(\x0b\x32".zmk.keymap.SetLayerBindingRequestH\x00\x12\x1f\n\x15\x63heck_unsaved_changes\x18\x03 \x01(\x08H\x00\x12\x16\n\x0csave_changes\x18\x04 \x01(\x08H\x00\x12\x19\n\x0f\x64iscard_changes\x18\x05 \x01(\x08H\x00\x12\x1e\n\x14get_physical_layouts\x18\x06 \x01(\x08H\x00\x12$\n\x1aset_active_physical_layout\x18\x07 \x01(\rH\x00\x12\x32\n\nmove_layer\x18\x08 \x01(\x0b\x32\x1c.zmk.keymap.MoveLayerRequestH\x00\x12\x30\n\tadd_layer\x18\t \x01(\x0b\x32\x1b.zmk.keymap.AddLayerRequestH\x00\x12\x36\n\x0cremove_layer\x18\n \x01(\x0b\x32\x1e.zmk.keymap.RemoveLayerRequestH\x00\x12\x38\n\rrestore_layer\x18\x0b \x01(\x0b\x32\x1f.zmk.keymap.RestoreLayerRequestH\x00\x12;\n\x0fset_layer_props\x18\x0c \x01(\x0b\x32 .zmk.keymap.SetLayerPropsRequestH\x00\x42\x0e\n\x0crequest_type"\xa6\x05\n\x08Response\x12(\n\nget_keymap\x18\x01 \x01(\x0b\x32\x12.zmk.keymap.KeymapH\x00\x12@\n\x11set_layer_binding\x18\x02 \x01(\x0e\x32#.zmk.keymap.SetLayerBindingResponseH\x00\x12\x1f\n\x15\x63heck_unsaved_changes\x18\x03 \x01(\x08H\x00\x12\x37\n\x0csave_changes\x18\x04 \x01(\x0b\x32\x1f.zmk.keymap.SaveChangesResponseH\x00\x12\x19\n\x0f\x64iscard_changes\x18\x05 \x01(\x08H\x00\x12;\n\x14get_physical_layouts\x18\x06 \x01(\x0b\x32\x1b.zmk.keymap.PhysicalLayoutsH\x00\x12Q\n\x1aset_active_physical_layout\x18\x07 \x01(\x0b\x32+.zmk.keymap.SetActivePhysicalLayoutResponseH\x00\x12\x33\n\nmove_layer\x18\x08 \x01(\x0b\x32\x1d.zmk.keymap.MoveLayerResponseH\x00\x12\x31\n\tadd_layer\x18\t \x01(\x0b\x32\x1c.zmk.keymap.AddLayerResponseH\x00\x12\x37\n\x0cremove_layer\x18\n \x01(\x0b\x32\x1f.zmk.keymap.RemoveLayerResponseH\x00\x12\x39\n\rrestore_layer\x18\x0b \x01(\x0b\x32 .zmk.keymap.RestoreLayerResponseH\x00\x12<\n\x0fset_layer_props\x18\x0c \x01(\x0e\x32!.zmk.keymap.SetLayerPropsResponseH\x00\x42\x0f\n\rresponse_type"M\n\x0cNotification\x12(\n\x1eunsaved_changes_status_changed\x18\x01 \x01(\x08H\x00\x42\x13\n\x11notification_type"^\n\x13SaveChangesResponse\x12\x0c\n\x02ok\x18\x01 \x01(\x08H\x00\x12/\n\x03\x65rr\x18\x02 \x01(\x0e\x32 .zmk.keymap.SaveChangesErrorCodeH\x00\x42\x08\n\x06result"\x8a\x01\n\x1fSetActivePhysicalLayoutResponse\x12 \n\x02ok\x18\x01 \x01(\x0b\x32\x12.zmk.keymap.KeymapH\x00\x12;\n\x03\x65rr\x18\x02 \x01(\x0e\x32,.zmk.keymap.SetActivePhysicalLayoutErrorCodeH\x00\x42\x08\n\x06result"n\n\x11MoveLayerResponse\x12 \n\x02ok\x18\x01 \x01(\x0b\x32\x12.zmk.keymap.KeymapH\x00\x12-\n\x03\x65rr\x18\x02 \x01(\x0e\x32\x1e.zmk.keymap.MoveLayerErrorCodeH\x00\x42\x08\n\x06result"}\n\x10\x41\x64\x64LayerResponse\x12\x31\n\x02ok\x18\x01 \x01(\x0b\x32#.zmk.keymap.AddLayerResponseDetailsH\x00\x12,\n\x03\x65rr\x18\x02 \x01(\x0e\x32\x1d.zmk.keymap.AddLayerErrorCodeH\x00\x42\x08\n\x06result"J\n\x17\x41\x64\x64LayerResponseDetails\x12\r\n\x05index\x18\x01 \x01(\r\x12 \n\x05layer\x18\x02 \x01(\x0b\x32\x11.zmk.keymap.Layer"y\n\x13RemoveLayerResponse\x12\'\n\x02ok\x18\x01 \x01(\x0b\x32\x19.zmk.keymap.RemoveLayerOkH\x00\x12/\n\x03\x65rr\x18\x02 \x01(\x0e\x32 .zmk.keymap.RemoveLayerErrorCodeH\x00\x42\x08\n\x06result"\x0f\n\rRemoveLayerOk"s\n\x14RestoreLayerResponse\x12\x1f\n\x02ok\x18\x01 \x01(\x0b\x32\x11.zmk.keymap.LayerH\x00\x12\x30\n\x03\x65rr\x18\x02 \x01(\x0e\x32!.zmk.keymap.RestoreLayerErrorCodeH\x00\x42\x08\n\x06result"n\n\x16SetLayerBindingRequest\x12\x10\n\x08layer_id\x18\x01 \x01(\r\x12\x14\n\x0ckey_position\x18\x02 \x01(\x05\x12,\n\x07\x62inding\x18\x03 \x01(\x0b\x32\x1b.zmk.keymap.BehaviorBinding";\n\x10MoveLayerRequest\x12\x13\n\x0bstart_index\x18\x01 \x01(\r\x12\x12\n\ndest_index\x18\x02 \x01(\r"\x11\n\x0f\x41\x64\x64LayerRequest")\n\x12RemoveLayerRequest\x12\x13\n\x0blayer_index\x18\x01 \x01(\r"9\n\x13RestoreLayerRequest\x12\x10\n\x08layer_id\x18\x01 \x01(\r\x12\x10\n\x08\x61t_index\x18\x02 \x01(\r"6\n\x14SetLayerPropsRequest\x12\x10\n\x08layer_id\x18\x01 \x01(\r\x12\x0c\n\x04name\x18\x02 \x01(\t"d\n\x06Keymap\x12!\n\x06layers\x18\x01 \x03(\x0b\x32\x11.zmk.keymap.Layer\x12\x18\n\x10\x61vailable_layers\x18\x02 \x01(\r\x12\x1d\n\x15max_layer_name_length\x18\x03 \x01(\r"P\n\x05Layer\x12\n\n\x02id\x18\x01 \x01(\r\x12\x0c\n\x04name\x18\x02 \x01(\t\x12-\n\x08\x62indings\x18\x03 \x03(\x0b\x32\x1b.zmk.keymap.BehaviorBinding"F\n\x0f\x42\x65haviorBinding\x12\x13\n\x0b\x62\x65havior_id\x18\x01 \x01(\x11\x12\x0e\n\x06param1\x18\x02 \x01(\r\x12\x0e\n\x06param2\x18\x03 \x01(\r"[\n\x0fPhysicalLayouts\x12\x1b\n\x13\x61\x63tive_layout_index\x18\x01 \x01(\r\x12+\n\x07layouts\x18\x02 \x03(\x0b\x32\x1a.zmk.keymap.PhysicalLayout"J\n\x0ePhysicalLayout\x12\x0c\n\x04name\x18\x01 \x01(\t\x12*\n\x04keys\x18\x02 \x03(\x0b\x32\x1c.zmk.keymap.KeyPhysicalAttrs"j\n\x10KeyPhysicalAttrs\x12\r\n\x05width\x18\x01 \x01(\x11\x12\x0e\n\x06height\x18\x02 \x01(\x11\x12\t\n\x01x\x18\x03 \x01(\x11\x12\t\n\x01y\x18\x04 \x01(\x11\x12\t\n\x01r\x18\x05 \x01(\x11\x12\n\n\x02rx\x18\x06 \x01(\x11\x12\n\n\x02ry\x18\x07 \x01(\x11*\x90\x01\n\x14SaveChangesErrorCode\x12\x17\n\x13SAVE_CHANGES_ERR_OK\x10\x00\x12\x1c\n\x18SAVE_CHANGES_ERR_GENERIC\x10\x01\x12"\n\x1eSAVE_CHANGES_ERR_NOT_SUPPORTED\x10\x02\x12\x1d\n\x19SAVE_CHANGES_ERR_NO_SPACE\x10\x03*\xc1\x01\n\x17SetLayerBindingResponse\x12\x1d\n\x19SET_LAYER_BINDING_RESP_OK\x10\x00\x12+\n\'SET_LAYER_BINDING_RESP_INVALID_LOCATION\x10\x01\x12+\n\'SET_LAYER_BINDING_RESP_INVALID_BEHAVIOR\x10\x02\x12-\n)SET_LAYER_BINDING_RESP_INVALID_PARAMETERS\x10\x03*\x91\x01\n\x12MoveLayerErrorCode\x12\x15\n\x11MOVE_LAYER_ERR_OK\x10\x00\x12\x1a\n\x16MOVE_LAYER_ERR_GENERIC\x10\x01\x12 \n\x1cMOVE_LAYER_ERR_INVALID_LAYER\x10\x02\x12&\n"MOVE_LAYER_ERR_INVALID_DESTINATION\x10\x03*`\n\x11\x41\x64\x64LayerErrorCode\x12\x14\n\x10\x41\x44\x44_LAYER_ERR_OK\x10\x00\x12\x19\n\x15\x41\x44\x44_LAYER_ERR_GENERIC\x10\x01\x12\x1a\n\x16\x41\x44\x44_LAYER_ERR_NO_SPACE\x10\x02*q\n\x14RemoveLayerErrorCode\x12\x17\n\x13REMOVE_LAYER_ERR_OK\x10\x00\x12\x1c\n\x18REMOVE_LAYER_ERR_GENERIC\x10\x01\x12"\n\x1eREMOVE_LAYER_ERR_INVALID_INDEX\x10\x02*\x97\x01\n\x15RestoreLayerErrorCode\x12\x18\n\x14RESTORE_LAYER_ERR_OK\x10\x00\x12\x1d\n\x19RESTORE_LAYER_ERR_GENERIC\x10\x01\x12 \n\x1cRESTORE_LAYER_ERR_INVALID_ID\x10\x02\x12#\n\x1fRESTORE_LAYER_ERR_INVALID_INDEX\x10\x03*\x83\x01\n\x15SetLayerPropsResponse\x12\x1b\n\x17SET_LAYER_PROPS_RESP_OK\x10\x00\x12$\n SET_LAYER_PROPS_RESP_ERR_GENERIC\x10\x01\x12\'\n#SET_LAYER_PROPS_RESP_ERR_INVALID_ID\x10\x02*\xae\x01\n SetActivePhysicalLayoutErrorCode\x12%\n!SET_ACTIVE_PHYSICAL_LAYOUT_ERR_OK\x10\x00\x12*\n&SET_ACTIVE_PHYSICAL_LAYOUT_ERR_GENERIC\x10\x01\x12\x37\n3SET_ACTIVE_PHYSICAL_LAYOUT_ERR_INVALID_LAYOUT_INDEX\x10\x02\x62\x06proto3' -) + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0ckeymap.proto\x12\nzmk.keymap\"\x9f\x04\n\x07Request\x12\x14\n\nget_keymap\x18\x01 \x01(\x08H\x00\x12?\n\x11set_layer_binding\x18\x02 \x01(\x0b\x32\".zmk.keymap.SetLayerBindingRequestH\x00\x12\x1f\n\x15\x63heck_unsaved_changes\x18\x03 \x01(\x08H\x00\x12\x16\n\x0csave_changes\x18\x04 \x01(\x08H\x00\x12\x19\n\x0f\x64iscard_changes\x18\x05 \x01(\x08H\x00\x12\x1e\n\x14get_physical_layouts\x18\x06 \x01(\x08H\x00\x12$\n\x1aset_active_physical_layout\x18\x07 \x01(\rH\x00\x12\x32\n\nmove_layer\x18\x08 \x01(\x0b\x32\x1c.zmk.keymap.MoveLayerRequestH\x00\x12\x30\n\tadd_layer\x18\t \x01(\x0b\x32\x1b.zmk.keymap.AddLayerRequestH\x00\x12\x36\n\x0cremove_layer\x18\n \x01(\x0b\x32\x1e.zmk.keymap.RemoveLayerRequestH\x00\x12\x38\n\rrestore_layer\x18\x0b \x01(\x0b\x32\x1f.zmk.keymap.RestoreLayerRequestH\x00\x12;\n\x0fset_layer_props\x18\x0c \x01(\x0b\x32 .zmk.keymap.SetLayerPropsRequestH\x00\x42\x0e\n\x0crequest_type\"\xa6\x05\n\x08Response\x12(\n\nget_keymap\x18\x01 \x01(\x0b\x32\x12.zmk.keymap.KeymapH\x00\x12@\n\x11set_layer_binding\x18\x02 \x01(\x0e\x32#.zmk.keymap.SetLayerBindingResponseH\x00\x12\x1f\n\x15\x63heck_unsaved_changes\x18\x03 \x01(\x08H\x00\x12\x37\n\x0csave_changes\x18\x04 \x01(\x0b\x32\x1f.zmk.keymap.SaveChangesResponseH\x00\x12\x19\n\x0f\x64iscard_changes\x18\x05 \x01(\x08H\x00\x12;\n\x14get_physical_layouts\x18\x06 \x01(\x0b\x32\x1b.zmk.keymap.PhysicalLayoutsH\x00\x12Q\n\x1aset_active_physical_layout\x18\x07 \x01(\x0b\x32+.zmk.keymap.SetActivePhysicalLayoutResponseH\x00\x12\x33\n\nmove_layer\x18\x08 \x01(\x0b\x32\x1d.zmk.keymap.MoveLayerResponseH\x00\x12\x31\n\tadd_layer\x18\t \x01(\x0b\x32\x1c.zmk.keymap.AddLayerResponseH\x00\x12\x37\n\x0cremove_layer\x18\n \x01(\x0b\x32\x1f.zmk.keymap.RemoveLayerResponseH\x00\x12\x39\n\rrestore_layer\x18\x0b \x01(\x0b\x32 .zmk.keymap.RestoreLayerResponseH\x00\x12<\n\x0fset_layer_props\x18\x0c \x01(\x0e\x32!.zmk.keymap.SetLayerPropsResponseH\x00\x42\x0f\n\rresponse_type\"M\n\x0cNotification\x12(\n\x1eunsaved_changes_status_changed\x18\x01 \x01(\x08H\x00\x42\x13\n\x11notification_type\"^\n\x13SaveChangesResponse\x12\x0c\n\x02ok\x18\x01 \x01(\x08H\x00\x12/\n\x03\x65rr\x18\x02 \x01(\x0e\x32 .zmk.keymap.SaveChangesErrorCodeH\x00\x42\x08\n\x06result\"\x8a\x01\n\x1fSetActivePhysicalLayoutResponse\x12 \n\x02ok\x18\x01 \x01(\x0b\x32\x12.zmk.keymap.KeymapH\x00\x12;\n\x03\x65rr\x18\x02 \x01(\x0e\x32,.zmk.keymap.SetActivePhysicalLayoutErrorCodeH\x00\x42\x08\n\x06result\"n\n\x11MoveLayerResponse\x12 \n\x02ok\x18\x01 \x01(\x0b\x32\x12.zmk.keymap.KeymapH\x00\x12-\n\x03\x65rr\x18\x02 \x01(\x0e\x32\x1e.zmk.keymap.MoveLayerErrorCodeH\x00\x42\x08\n\x06result\"}\n\x10\x41\x64\x64LayerResponse\x12\x31\n\x02ok\x18\x01 \x01(\x0b\x32#.zmk.keymap.AddLayerResponseDetailsH\x00\x12,\n\x03\x65rr\x18\x02 \x01(\x0e\x32\x1d.zmk.keymap.AddLayerErrorCodeH\x00\x42\x08\n\x06result\"J\n\x17\x41\x64\x64LayerResponseDetails\x12\r\n\x05index\x18\x01 \x01(\r\x12 \n\x05layer\x18\x02 \x01(\x0b\x32\x11.zmk.keymap.Layer\"y\n\x13RemoveLayerResponse\x12\'\n\x02ok\x18\x01 \x01(\x0b\x32\x19.zmk.keymap.RemoveLayerOkH\x00\x12/\n\x03\x65rr\x18\x02 \x01(\x0e\x32 .zmk.keymap.RemoveLayerErrorCodeH\x00\x42\x08\n\x06result\"\x0f\n\rRemoveLayerOk\"s\n\x14RestoreLayerResponse\x12\x1f\n\x02ok\x18\x01 \x01(\x0b\x32\x11.zmk.keymap.LayerH\x00\x12\x30\n\x03\x65rr\x18\x02 \x01(\x0e\x32!.zmk.keymap.RestoreLayerErrorCodeH\x00\x42\x08\n\x06result\"n\n\x16SetLayerBindingRequest\x12\x10\n\x08layer_id\x18\x01 \x01(\r\x12\x14\n\x0ckey_position\x18\x02 \x01(\x05\x12,\n\x07\x62inding\x18\x03 \x01(\x0b\x32\x1b.zmk.keymap.BehaviorBinding\";\n\x10MoveLayerRequest\x12\x13\n\x0bstart_index\x18\x01 \x01(\r\x12\x12\n\ndest_index\x18\x02 \x01(\r\"\x11\n\x0f\x41\x64\x64LayerRequest\")\n\x12RemoveLayerRequest\x12\x13\n\x0blayer_index\x18\x01 \x01(\r\"9\n\x13RestoreLayerRequest\x12\x10\n\x08layer_id\x18\x01 \x01(\r\x12\x10\n\x08\x61t_index\x18\x02 \x01(\r\"6\n\x14SetLayerPropsRequest\x12\x10\n\x08layer_id\x18\x01 \x01(\r\x12\x0c\n\x04name\x18\x02 \x01(\t\"d\n\x06Keymap\x12!\n\x06layers\x18\x01 \x03(\x0b\x32\x11.zmk.keymap.Layer\x12\x18\n\x10\x61vailable_layers\x18\x02 \x01(\r\x12\x1d\n\x15max_layer_name_length\x18\x03 \x01(\r\"P\n\x05Layer\x12\n\n\x02id\x18\x01 \x01(\r\x12\x0c\n\x04name\x18\x02 \x01(\t\x12-\n\x08\x62indings\x18\x03 \x03(\x0b\x32\x1b.zmk.keymap.BehaviorBinding\"F\n\x0f\x42\x65haviorBinding\x12\x13\n\x0b\x62\x65havior_id\x18\x01 \x01(\x11\x12\x0e\n\x06param1\x18\x02 \x01(\r\x12\x0e\n\x06param2\x18\x03 \x01(\r\"[\n\x0fPhysicalLayouts\x12\x1b\n\x13\x61\x63tive_layout_index\x18\x01 \x01(\r\x12+\n\x07layouts\x18\x02 \x03(\x0b\x32\x1a.zmk.keymap.PhysicalLayout\"J\n\x0ePhysicalLayout\x12\x0c\n\x04name\x18\x01 \x01(\t\x12*\n\x04keys\x18\x02 \x03(\x0b\x32\x1c.zmk.keymap.KeyPhysicalAttrs\"j\n\x10KeyPhysicalAttrs\x12\r\n\x05width\x18\x01 \x01(\x11\x12\x0e\n\x06height\x18\x02 \x01(\x11\x12\t\n\x01x\x18\x03 \x01(\x11\x12\t\n\x01y\x18\x04 \x01(\x11\x12\t\n\x01r\x18\x05 \x01(\x11\x12\n\n\x02rx\x18\x06 \x01(\x11\x12\n\n\x02ry\x18\x07 \x01(\x11*\x90\x01\n\x14SaveChangesErrorCode\x12\x17\n\x13SAVE_CHANGES_ERR_OK\x10\x00\x12\x1c\n\x18SAVE_CHANGES_ERR_GENERIC\x10\x01\x12\"\n\x1eSAVE_CHANGES_ERR_NOT_SUPPORTED\x10\x02\x12\x1d\n\x19SAVE_CHANGES_ERR_NO_SPACE\x10\x03*\xc1\x01\n\x17SetLayerBindingResponse\x12\x1d\n\x19SET_LAYER_BINDING_RESP_OK\x10\x00\x12+\n\'SET_LAYER_BINDING_RESP_INVALID_LOCATION\x10\x01\x12+\n\'SET_LAYER_BINDING_RESP_INVALID_BEHAVIOR\x10\x02\x12-\n)SET_LAYER_BINDING_RESP_INVALID_PARAMETERS\x10\x03*\x91\x01\n\x12MoveLayerErrorCode\x12\x15\n\x11MOVE_LAYER_ERR_OK\x10\x00\x12\x1a\n\x16MOVE_LAYER_ERR_GENERIC\x10\x01\x12 \n\x1cMOVE_LAYER_ERR_INVALID_LAYER\x10\x02\x12&\n\"MOVE_LAYER_ERR_INVALID_DESTINATION\x10\x03*`\n\x11\x41\x64\x64LayerErrorCode\x12\x14\n\x10\x41\x44\x44_LAYER_ERR_OK\x10\x00\x12\x19\n\x15\x41\x44\x44_LAYER_ERR_GENERIC\x10\x01\x12\x1a\n\x16\x41\x44\x44_LAYER_ERR_NO_SPACE\x10\x02*q\n\x14RemoveLayerErrorCode\x12\x17\n\x13REMOVE_LAYER_ERR_OK\x10\x00\x12\x1c\n\x18REMOVE_LAYER_ERR_GENERIC\x10\x01\x12\"\n\x1eREMOVE_LAYER_ERR_INVALID_INDEX\x10\x02*\x97\x01\n\x15RestoreLayerErrorCode\x12\x18\n\x14RESTORE_LAYER_ERR_OK\x10\x00\x12\x1d\n\x19RESTORE_LAYER_ERR_GENERIC\x10\x01\x12 \n\x1cRESTORE_LAYER_ERR_INVALID_ID\x10\x02\x12#\n\x1fRESTORE_LAYER_ERR_INVALID_INDEX\x10\x03*\x83\x01\n\x15SetLayerPropsResponse\x12\x1b\n\x17SET_LAYER_PROPS_RESP_OK\x10\x00\x12$\n SET_LAYER_PROPS_RESP_ERR_GENERIC\x10\x01\x12\'\n#SET_LAYER_PROPS_RESP_ERR_INVALID_ID\x10\x02*\xae\x01\n SetActivePhysicalLayoutErrorCode\x12%\n!SET_ACTIVE_PHYSICAL_LAYOUT_ERR_OK\x10\x00\x12*\n&SET_ACTIVE_PHYSICAL_LAYOUT_ERR_GENERIC\x10\x01\x12\x37\n3SET_ACTIVE_PHYSICAL_LAYOUT_ERR_INVALID_LAYOUT_INDEX\x10\x02\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "keymap_pb2", _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'keymap_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: - DESCRIPTOR._loaded_options = None - _globals["_SAVECHANGESERRORCODE"]._serialized_start = 3027 - _globals["_SAVECHANGESERRORCODE"]._serialized_end = 3171 - _globals["_SETLAYERBINDINGRESPONSE"]._serialized_start = 3174 - _globals["_SETLAYERBINDINGRESPONSE"]._serialized_end = 3367 - _globals["_MOVELAYERERRORCODE"]._serialized_start = 3370 - _globals["_MOVELAYERERRORCODE"]._serialized_end = 3515 - _globals["_ADDLAYERERRORCODE"]._serialized_start = 3517 - _globals["_ADDLAYERERRORCODE"]._serialized_end = 3613 - _globals["_REMOVELAYERERRORCODE"]._serialized_start = 3615 - _globals["_REMOVELAYERERRORCODE"]._serialized_end = 3728 - _globals["_RESTORELAYERERRORCODE"]._serialized_start = 3731 - _globals["_RESTORELAYERERRORCODE"]._serialized_end = 3882 - _globals["_SETLAYERPROPSRESPONSE"]._serialized_start = 3885 - _globals["_SETLAYERPROPSRESPONSE"]._serialized_end = 4016 - _globals["_SETACTIVEPHYSICALLAYOUTERRORCODE"]._serialized_start = 4019 - _globals["_SETACTIVEPHYSICALLAYOUTERRORCODE"]._serialized_end = 4193 - _globals["_REQUEST"]._serialized_start = 29 - _globals["_REQUEST"]._serialized_end = 572 - _globals["_RESPONSE"]._serialized_start = 575 - _globals["_RESPONSE"]._serialized_end = 1253 - _globals["_NOTIFICATION"]._serialized_start = 1255 - _globals["_NOTIFICATION"]._serialized_end = 1332 - _globals["_SAVECHANGESRESPONSE"]._serialized_start = 1334 - _globals["_SAVECHANGESRESPONSE"]._serialized_end = 1428 - _globals["_SETACTIVEPHYSICALLAYOUTRESPONSE"]._serialized_start = 1431 - _globals["_SETACTIVEPHYSICALLAYOUTRESPONSE"]._serialized_end = 1569 - _globals["_MOVELAYERRESPONSE"]._serialized_start = 1571 - _globals["_MOVELAYERRESPONSE"]._serialized_end = 1681 - _globals["_ADDLAYERRESPONSE"]._serialized_start = 1683 - _globals["_ADDLAYERRESPONSE"]._serialized_end = 1808 - _globals["_ADDLAYERRESPONSEDETAILS"]._serialized_start = 1810 - _globals["_ADDLAYERRESPONSEDETAILS"]._serialized_end = 1884 - _globals["_REMOVELAYERRESPONSE"]._serialized_start = 1886 - _globals["_REMOVELAYERRESPONSE"]._serialized_end = 2007 - _globals["_REMOVELAYEROK"]._serialized_start = 2009 - _globals["_REMOVELAYEROK"]._serialized_end = 2024 - _globals["_RESTORELAYERRESPONSE"]._serialized_start = 2026 - _globals["_RESTORELAYERRESPONSE"]._serialized_end = 2141 - _globals["_SETLAYERBINDINGREQUEST"]._serialized_start = 2143 - _globals["_SETLAYERBINDINGREQUEST"]._serialized_end = 2253 - _globals["_MOVELAYERREQUEST"]._serialized_start = 2255 - _globals["_MOVELAYERREQUEST"]._serialized_end = 2314 - _globals["_ADDLAYERREQUEST"]._serialized_start = 2316 - _globals["_ADDLAYERREQUEST"]._serialized_end = 2333 - _globals["_REMOVELAYERREQUEST"]._serialized_start = 2335 - _globals["_REMOVELAYERREQUEST"]._serialized_end = 2376 - _globals["_RESTORELAYERREQUEST"]._serialized_start = 2378 - _globals["_RESTORELAYERREQUEST"]._serialized_end = 2435 - _globals["_SETLAYERPROPSREQUEST"]._serialized_start = 2437 - _globals["_SETLAYERPROPSREQUEST"]._serialized_end = 2491 - _globals["_KEYMAP"]._serialized_start = 2493 - _globals["_KEYMAP"]._serialized_end = 2593 - _globals["_LAYER"]._serialized_start = 2595 - _globals["_LAYER"]._serialized_end = 2675 - _globals["_BEHAVIORBINDING"]._serialized_start = 2677 - _globals["_BEHAVIORBINDING"]._serialized_end = 2747 - _globals["_PHYSICALLAYOUTS"]._serialized_start = 2749 - _globals["_PHYSICALLAYOUTS"]._serialized_end = 2840 - _globals["_PHYSICALLAYOUT"]._serialized_start = 2842 - _globals["_PHYSICALLAYOUT"]._serialized_end = 2916 - _globals["_KEYPHYSICALATTRS"]._serialized_start = 2918 - _globals["_KEYPHYSICALATTRS"]._serialized_end = 3024 + DESCRIPTOR._loaded_options = None + _globals['_SAVECHANGESERRORCODE']._serialized_start=3027 + _globals['_SAVECHANGESERRORCODE']._serialized_end=3171 + _globals['_SETLAYERBINDINGRESPONSE']._serialized_start=3174 + _globals['_SETLAYERBINDINGRESPONSE']._serialized_end=3367 + _globals['_MOVELAYERERRORCODE']._serialized_start=3370 + _globals['_MOVELAYERERRORCODE']._serialized_end=3515 + _globals['_ADDLAYERERRORCODE']._serialized_start=3517 + _globals['_ADDLAYERERRORCODE']._serialized_end=3613 + _globals['_REMOVELAYERERRORCODE']._serialized_start=3615 + _globals['_REMOVELAYERERRORCODE']._serialized_end=3728 + _globals['_RESTORELAYERERRORCODE']._serialized_start=3731 + _globals['_RESTORELAYERERRORCODE']._serialized_end=3882 + _globals['_SETLAYERPROPSRESPONSE']._serialized_start=3885 + _globals['_SETLAYERPROPSRESPONSE']._serialized_end=4016 + _globals['_SETACTIVEPHYSICALLAYOUTERRORCODE']._serialized_start=4019 + _globals['_SETACTIVEPHYSICALLAYOUTERRORCODE']._serialized_end=4193 + _globals['_REQUEST']._serialized_start=29 + _globals['_REQUEST']._serialized_end=572 + _globals['_RESPONSE']._serialized_start=575 + _globals['_RESPONSE']._serialized_end=1253 + _globals['_NOTIFICATION']._serialized_start=1255 + _globals['_NOTIFICATION']._serialized_end=1332 + _globals['_SAVECHANGESRESPONSE']._serialized_start=1334 + _globals['_SAVECHANGESRESPONSE']._serialized_end=1428 + _globals['_SETACTIVEPHYSICALLAYOUTRESPONSE']._serialized_start=1431 + _globals['_SETACTIVEPHYSICALLAYOUTRESPONSE']._serialized_end=1569 + _globals['_MOVELAYERRESPONSE']._serialized_start=1571 + _globals['_MOVELAYERRESPONSE']._serialized_end=1681 + _globals['_ADDLAYERRESPONSE']._serialized_start=1683 + _globals['_ADDLAYERRESPONSE']._serialized_end=1808 + _globals['_ADDLAYERRESPONSEDETAILS']._serialized_start=1810 + _globals['_ADDLAYERRESPONSEDETAILS']._serialized_end=1884 + _globals['_REMOVELAYERRESPONSE']._serialized_start=1886 + _globals['_REMOVELAYERRESPONSE']._serialized_end=2007 + _globals['_REMOVELAYEROK']._serialized_start=2009 + _globals['_REMOVELAYEROK']._serialized_end=2024 + _globals['_RESTORELAYERRESPONSE']._serialized_start=2026 + _globals['_RESTORELAYERRESPONSE']._serialized_end=2141 + _globals['_SETLAYERBINDINGREQUEST']._serialized_start=2143 + _globals['_SETLAYERBINDINGREQUEST']._serialized_end=2253 + _globals['_MOVELAYERREQUEST']._serialized_start=2255 + _globals['_MOVELAYERREQUEST']._serialized_end=2314 + _globals['_ADDLAYERREQUEST']._serialized_start=2316 + _globals['_ADDLAYERREQUEST']._serialized_end=2333 + _globals['_REMOVELAYERREQUEST']._serialized_start=2335 + _globals['_REMOVELAYERREQUEST']._serialized_end=2376 + _globals['_RESTORELAYERREQUEST']._serialized_start=2378 + _globals['_RESTORELAYERREQUEST']._serialized_end=2435 + _globals['_SETLAYERPROPSREQUEST']._serialized_start=2437 + _globals['_SETLAYERPROPSREQUEST']._serialized_end=2491 + _globals['_KEYMAP']._serialized_start=2493 + _globals['_KEYMAP']._serialized_end=2593 + _globals['_LAYER']._serialized_start=2595 + _globals['_LAYER']._serialized_end=2675 + _globals['_BEHAVIORBINDING']._serialized_start=2677 + _globals['_BEHAVIORBINDING']._serialized_end=2747 + _globals['_PHYSICALLAYOUTS']._serialized_start=2749 + _globals['_PHYSICALLAYOUTS']._serialized_end=2840 + _globals['_PHYSICALLAYOUT']._serialized_start=2842 + _globals['_PHYSICALLAYOUT']._serialized_end=2916 + _globals['_KEYPHYSICALATTRS']._serialized_start=2918 + _globals['_KEYPHYSICALATTRS']._serialized_end=3024 # @@protoc_insertion_point(module_scope) diff --git a/zmk_studio_cli/proto/meta_pb2.py b/zmk_studio_cli/proto/meta_pb2.py index b6323e7..422262b 100644 --- a/zmk_studio_cli/proto/meta_pb2.py +++ b/zmk_studio_cli/proto/meta_pb2.py @@ -2,33 +2,37 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: meta.proto -# Protobuf Python Version: 6.33.0 +# Protobuf Python Version: 6.31.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder - _runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, 6, 33, 0, "", "meta.proto" + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'meta.proto' ) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\nmeta.proto\x12\x08zmk.meta"e\n\x08Response\x12\x15\n\x0bno_response\x18\x01 \x01(\x08H\x00\x12\x31\n\x0csimple_error\x18\x02 \x01(\x0e\x32\x19.zmk.meta.ErrorConditionsH\x00\x42\x0f\n\rresponse_type*t\n\x0f\x45rrorConditions\x12\x0b\n\x07GENERIC\x10\x00\x12\x13\n\x0fUNLOCK_REQUIRED\x10\x01\x12\x11\n\rRPC_NOT_FOUND\x10\x02\x12\x15\n\x11MSG_DECODE_FAILED\x10\x03\x12\x15\n\x11MSG_ENCODE_FAILED\x10\x04\x62\x06proto3' -) + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\nmeta.proto\x12\x08zmk.meta\"e\n\x08Response\x12\x15\n\x0bno_response\x18\x01 \x01(\x08H\x00\x12\x31\n\x0csimple_error\x18\x02 \x01(\x0e\x32\x19.zmk.meta.ErrorConditionsH\x00\x42\x0f\n\rresponse_type*t\n\x0f\x45rrorConditions\x12\x0b\n\x07GENERIC\x10\x00\x12\x13\n\x0fUNLOCK_REQUIRED\x10\x01\x12\x11\n\rRPC_NOT_FOUND\x10\x02\x12\x15\n\x11MSG_DECODE_FAILED\x10\x03\x12\x15\n\x11MSG_ENCODE_FAILED\x10\x04\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "meta_pb2", _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meta_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: - DESCRIPTOR._loaded_options = None - _globals["_ERRORCONDITIONS"]._serialized_start = 127 - _globals["_ERRORCONDITIONS"]._serialized_end = 243 - _globals["_RESPONSE"]._serialized_start = 24 - _globals["_RESPONSE"]._serialized_end = 125 + DESCRIPTOR._loaded_options = None + _globals['_ERRORCONDITIONS']._serialized_start=127 + _globals['_ERRORCONDITIONS']._serialized_end=243 + _globals['_RESPONSE']._serialized_start=24 + _globals['_RESPONSE']._serialized_end=125 # @@protoc_insertion_point(module_scope) diff --git a/zmk_studio_cli/proto/studio_pb2.py b/zmk_studio_cli/proto/studio_pb2.py index cd045f3..034c13d 100644 --- a/zmk_studio_cli/proto/studio_pb2.py +++ b/zmk_studio_cli/proto/studio_pb2.py @@ -2,42 +2,46 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: studio.proto -# Protobuf Python Version: 6.33.0 +# Protobuf Python Version: 6.31.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder - _runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, 6, 33, 0, "", "studio.proto" + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'studio.proto' ) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() -from . import behaviors_pb2 as behaviors__pb2 +from . import meta_pb2 as meta__pb2 from . import core_pb2 as core__pb2 +from . import behaviors_pb2 as behaviors__pb2 from . import keymap_pb2 as keymap__pb2 -from . import meta_pb2 as meta__pb2 +from . import combos_pb2 as combos__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( - b'\n\x0cstudio.proto\x12\nzmk.studio\x1a\nmeta.proto\x1a\ncore.proto\x1a\x0f\x62\x65haviors.proto\x1a\x0ckeymap.proto"\xa1\x01\n\x07Request\x12\x12\n\nrequest_id\x18\x01 \x01(\r\x12!\n\x04\x63ore\x18\x03 \x01(\x0b\x32\x11.zmk.core.RequestH\x00\x12+\n\tbehaviors\x18\x04 \x01(\x0b\x32\x16.zmk.behaviors.RequestH\x00\x12%\n\x06keymap\x18\x05 \x01(\x0b\x32\x13.zmk.keymap.RequestH\x00\x42\x0b\n\tsubsystem"}\n\x08Response\x12\x37\n\x10request_response\x18\x01 \x01(\x0b\x32\x1b.zmk.studio.RequestResponseH\x00\x12\x30\n\x0cnotification\x18\x02 \x01(\x0b\x32\x18.zmk.studio.NotificationH\x00\x42\x06\n\x04type"\xd0\x01\n\x0fRequestResponse\x12\x12\n\nrequest_id\x18\x01 \x01(\r\x12"\n\x04meta\x18\x02 \x01(\x0b\x32\x12.zmk.meta.ResponseH\x00\x12"\n\x04\x63ore\x18\x03 \x01(\x0b\x32\x12.zmk.core.ResponseH\x00\x12,\n\tbehaviors\x18\x04 \x01(\x0b\x32\x17.zmk.behaviors.ResponseH\x00\x12&\n\x06keymap\x18\x05 \x01(\x0b\x32\x14.zmk.keymap.ResponseH\x00\x42\x0b\n\tsubsystem"o\n\x0cNotification\x12&\n\x04\x63ore\x18\x02 \x01(\x0b\x32\x16.zmk.core.NotificationH\x00\x12*\n\x06keymap\x18\x05 \x01(\x0b\x32\x18.zmk.keymap.NotificationH\x00\x42\x0b\n\tsubsystemb\x06proto3' -) + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cstudio.proto\x12\nzmk.studio\x1a\nmeta.proto\x1a\ncore.proto\x1a\x0f\x62\x65haviors.proto\x1a\x0ckeymap.proto\x1a\x0c\x63ombos.proto\"\xc8\x01\n\x07Request\x12\x12\n\nrequest_id\x18\x01 \x01(\r\x12!\n\x04\x63ore\x18\x03 \x01(\x0b\x32\x11.zmk.core.RequestH\x00\x12+\n\tbehaviors\x18\x04 \x01(\x0b\x32\x16.zmk.behaviors.RequestH\x00\x12%\n\x06keymap\x18\x05 \x01(\x0b\x32\x13.zmk.keymap.RequestH\x00\x12%\n\x06\x63ombos\x18\x06 \x01(\x0b\x32\x13.zmk.combos.RequestH\x00\x42\x0b\n\tsubsystem\"}\n\x08Response\x12\x37\n\x10request_response\x18\x01 \x01(\x0b\x32\x1b.zmk.studio.RequestResponseH\x00\x12\x30\n\x0cnotification\x18\x02 \x01(\x0b\x32\x18.zmk.studio.NotificationH\x00\x42\x06\n\x04type\"\xf8\x01\n\x0fRequestResponse\x12\x12\n\nrequest_id\x18\x01 \x01(\r\x12\"\n\x04meta\x18\x02 \x01(\x0b\x32\x12.zmk.meta.ResponseH\x00\x12\"\n\x04\x63ore\x18\x03 \x01(\x0b\x32\x12.zmk.core.ResponseH\x00\x12,\n\tbehaviors\x18\x04 \x01(\x0b\x32\x17.zmk.behaviors.ResponseH\x00\x12&\n\x06keymap\x18\x05 \x01(\x0b\x32\x14.zmk.keymap.ResponseH\x00\x12&\n\x06\x63ombos\x18\x06 \x01(\x0b\x32\x14.zmk.combos.ResponseH\x00\x42\x0b\n\tsubsystem\"\x9b\x01\n\x0cNotification\x12&\n\x04\x63ore\x18\x02 \x01(\x0b\x32\x16.zmk.core.NotificationH\x00\x12*\n\x06keymap\x18\x05 \x01(\x0b\x32\x18.zmk.keymap.NotificationH\x00\x12*\n\x06\x63ombos\x18\x06 \x01(\x0b\x32\x18.zmk.combos.NotificationH\x00\x42\x0b\n\tsubsystemb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, "studio_pb2", _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'studio_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: - DESCRIPTOR._loaded_options = None - _globals["_REQUEST"]._serialized_start = 84 - _globals["_REQUEST"]._serialized_end = 245 - _globals["_RESPONSE"]._serialized_start = 247 - _globals["_RESPONSE"]._serialized_end = 372 - _globals["_REQUESTRESPONSE"]._serialized_start = 375 - _globals["_REQUESTRESPONSE"]._serialized_end = 583 - _globals["_NOTIFICATION"]._serialized_start = 585 - _globals["_NOTIFICATION"]._serialized_end = 696 + DESCRIPTOR._loaded_options = None + _globals['_REQUEST']._serialized_start=98 + _globals['_REQUEST']._serialized_end=298 + _globals['_RESPONSE']._serialized_start=300 + _globals['_RESPONSE']._serialized_end=425 + _globals['_REQUESTRESPONSE']._serialized_start=428 + _globals['_REQUESTRESPONSE']._serialized_end=676 + _globals['_NOTIFICATION']._serialized_start=679 + _globals['_NOTIFICATION']._serialized_end=834 # @@protoc_insertion_point(module_scope) diff --git a/zmk_studio_cli/rpc/handle_response_raw.py b/zmk_studio_cli/rpc/handle_response_raw.py index d986a3a..5bfeb4d 100644 --- a/zmk_studio_cli/rpc/handle_response_raw.py +++ b/zmk_studio_cli/rpc/handle_response_raw.py @@ -10,6 +10,7 @@ from ..logger import log_err from ..proto import studio_pb2 as studio from .subsystems.behaviors import handle_request_response_behaviors +from .subsystems.combos import handle_request_response_combos from .subsystems.core import handle_notification_core, handle_request_response_core from .subsystems.keymap import ( handle_notification_keymap, @@ -48,6 +49,8 @@ def handle_request_response(request_response: studio.RequestResponse): handle_request_response_core(request_response.core) if req_response_subsystem == "behaviors": handle_request_response_behaviors(request_response.behaviors) + if req_response_subsystem == "combos": + handle_request_response_combos(request_response.combos) if req_response_subsystem == "keymap": handle_request_response_keymap(request_response.keymap) diff --git a/zmk_studio_cli/rpc/subsystems/combos/__init__.py b/zmk_studio_cli/rpc/subsystems/combos/__init__.py new file mode 100644 index 0000000..3ef4759 --- /dev/null +++ b/zmk_studio_cli/rpc/subsystems/combos/__init__.py @@ -0,0 +1,11 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT +"""ZMK Studio combos RPC handlers""" + +from ....proto import combos_pb2 as combos +from .handle_response import handle_response + + +def handle_request_response_combos(request_response: combos.Response): + """Handle RequestResponse of type behaviors""" + handle_response(request_response) diff --git a/zmk_studio_cli/rpc/subsystems/combos/handle_response.py b/zmk_studio_cli/rpc/subsystems/combos/handle_response.py new file mode 100644 index 0000000..19f5558 --- /dev/null +++ b/zmk_studio_cli/rpc/subsystems/combos/handle_response.py @@ -0,0 +1,69 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT +"""combos Response handler""" + +from ....logger import log_dbg +from ....proto import combos_pb2 as combos + + +def handle_response(response: combos.Response): + """Handle combos Response from ZMK Studio RPC Protocol""" + response_type = response.WhichOneof("response_type") + if response_type == "get_combos": + handle_response_get_combos(response=response) + elif response_type == "add_combo": + handle_response_add_combo(response=response) + elif response_type == "delete_combo": + handle_response_delete_combo(response=response) + elif response_type == "set_combo_layer_state": + handle_response_set_combo_layer_state(response=response) + elif response_type == "set_combo_position_state": + handle_response_set_combo_position_state(response=response) + elif response_type == "set_combo_binding": + handle_response_set_combo_binding(response=response) + elif response_type == "set_combo_timeout": + handle_response_set_combo_timeout(response=response) + elif response_type == "set_combo_slow_release_state": + handle_response_set_combo_slow_release_state(response=response) + else: + log_wrn("combos", "Unhandled combos response type") + +def handle_response_get_combos(response: combos.Response): + """Print behavior details""" + combos = response.get_combos + log_dbg("combos", combos) + +def handle_response_add_combo(response: combos.Response): + """Print add combo response""" + combo = response.add_combo + log_dbg("combos", combo) + +def handle_response_delete_combo(response: combos.Response): + """Print delete combo response""" + res = response.delete_combo + log_dbg("combos", res) + +def handle_response_set_combo_layer_state(response: combos.Response): + """Print set combo layer state response""" + res = response.set_combo_layer_state + log_dbg("combos", res) + +def handle_response_set_combo_position_state(response: combos.Response): + """Print set combo position state response""" + res = response.set_combo_position_state + log_dbg("combos", res) + +def handle_response_set_combo_timeout(response: combos.Response): + """Print set combo position state response""" + res = response.set_combo_timeout + log_dbg("combos", res) + +def handle_response_set_combo_binding(response: combos.Response): + """Print set combo position state response""" + res = response.set_combo_binding + log_dbg("combos", res) + +def handle_response_set_combo_slow_release_state(response: combos.Response): + """Print set combo slow-reease state response""" + res = response.set_combo_slow_release_state + log_dbg("combos", res) diff --git a/zmk_studio_cli/rpc/subsystems/core/handle_response.py b/zmk_studio_cli/rpc/subsystems/core/handle_response.py index 6fccc4d..81abe58 100644 --- a/zmk_studio_cli/rpc/subsystems/core/handle_response.py +++ b/zmk_studio_cli/rpc/subsystems/core/handle_response.py @@ -16,6 +16,12 @@ def handle_response(response: core.Response): handle_response_get_lock_state(response=response) if response_type == "reset_settings": handle_response_reset_settings(response=response) + if response_type == "save_changes": + handle_response_save_changes(response=response) + if response_type == "discard_changes": + handle_response_discard_changes(response=response) + if response_type == "check_unsaved_changes": + handle_response_check_unsaved_changes(response=response) def handle_response_get_device_info(response: core.Response): @@ -34,3 +40,21 @@ def handle_response_get_lock_state(response: core.Response): def handle_response_reset_settings(response: core.Response): """Print reset settings status""" log_dbg("core", f"Reset settings: {response.reset_settings}") + + +def handle_response_save_changes(response: core.Response): + """Print check unsaved changes""" + res = response.save_changes + log_dbg("core", f"saved changes? {res}") + + +def handle_response_discard_changes(response: core.Response): + """Print discard changes result""" + res = response.discard_changes + log_dbg("core", f"discard changes? {res}") + + +def handle_response_check_unsaved_changes(response: core.Response): + """Print check unsaved changes""" + unsaved = response.check_unsaved_changes + log_dbg("core", f"Unsaved changes? {unsaved}")