From ba9f12810f7dc4969ac175f6e959d5fe6407747d Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 30 Dec 2024 18:22:41 +0100 Subject: feat(treewide): Migrate the Unicode handling to a custom c program, that works via rawhid --- rust/qmk-hid-com/src/cli.rs | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 rust/qmk-hid-com/src/cli.rs (limited to 'rust/qmk-hid-com/src/cli.rs') diff --git a/rust/qmk-hid-com/src/cli.rs b/rust/qmk-hid-com/src/cli.rs new file mode 100644 index 0000000..afef1a9 --- /dev/null +++ b/rust/qmk-hid-com/src/cli.rs @@ -0,0 +1,40 @@ +use clap::{command, Parser, Subcommand}; + +#[derive(Parser, Debug)] +pub struct CliArgs { + #[clap(subcommand)] + pub command: Command, +} +#[derive(Clone, Debug, Subcommand)] +pub enum Command { + /// List all devices, where the manufacturer string contains the search key + Search { + /// The part that must be contained in the manufacturer name + vendor_name: String, + }, + + /// Talk to the device specified by the [`vendor_id`] and [`product_id`]. + Send { + usage_page: u16, + usage_id: u16, + message: u8, + }, + + /// Talk to the device specified by the [`vendor_id`] and [`product_id`]. + Monitor { usage_page: u16, usage_id: u16 }, + + Inform { + #[command(subcommand)] + command: Inform, + }, + + ArrInform { values: Vec }, +} + +#[derive(Subcommand, Clone, Debug)] +pub enum Inform { + Hex { val: String }, + Dec { val: i64 }, + Bin { val: String }, + Char { val: char }, +} -- cgit 1.4.1