From 11ae3df723397e04192d6f357014cf04a61697ed Mon Sep 17 00:00:00 2001 From: Andrey Viktorov Date: Sun, 9 Feb 2025 15:21:02 +0700 Subject: [PATCH] Fix Ajazz AKP153R --- README.md | 2 +- src/asynchronous.rs | 2 +- src/lib.rs | 4 ++-- src/util.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4b09c59..77ecb7e 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,6 @@ As it stands, this library should support the following devices: - Stream Deck Neo (thanks to [@ejiektpobehuk](https://github.com/ejiektpobehuk), [@AkechiShiro](https://github.com/AkechiShiro) and [node-elgato-stream-deck](https://github.com/Julusian/node-elgato-stream-deck)) - Ajazz AKP153 (thanks to [@ZCube](https://github.com/ZCube)) - Ajazz AKP153E (thanks to [@teras](https://github.com/teras)) -- Ajazz AKP153R (thanks to [@teras](https://github.com/teras) and [@damnkrat](https://github.com/damnkrat)) +- Ajazz AKP153R (thanks to [@teras](https://github.com/teras), [@damnkrat](https://github.com/damnkrat) and [@4ndv](https://github.com/4ndv)) - Ajazz AKP815 (thanks to [@teras](https://github.com/teras)) - MiraBox HSV293S (thanks to [@czyz](https://github.com/czyz)) diff --git a/src/asynchronous.rs b/src/asynchronous.rs index 1b53496..36d5795 100644 --- a/src/asynchronous.rs +++ b/src/asynchronous.rs @@ -222,7 +222,7 @@ impl AsyncDeviceStateReader { StreamDeckInput::ButtonStateChange(buttons) => { for (index, (their, mine)) in zip(buttons.iter(), my_states.buttons.iter()).enumerate() { match self.device.kind { - Kind::Akp153 | Kind::Akp153E | Kind::Akp815 | Kind::MiraBoxHSV293S => { + Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::MiraBoxHSV293S => { if *their { updates.push(DeviceStateUpdate::ButtonDown(index as u8)); updates.push(DeviceStateUpdate::ButtonUp(index as u8)); diff --git a/src/lib.rs b/src/lib.rs index 7b8c8b9..2b1a9e0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -160,7 +160,7 @@ impl StreamDeck { /// Returns serial number of the device pub fn serial_number(&self) -> Result { match self.kind { - Kind::Akp153 | Kind::Akp153E | Kind::Akp815 | Kind::MiraBoxHSV293S => { + Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::MiraBoxHSV293S => { let serial = self.device.get_serial_number_string()?; match serial { Some(serial) => { @@ -200,7 +200,7 @@ impl StreamDeck { Ok(extract_str(&bytes[5..])?) } - Kind::Akp153 | Kind::Akp153E | Kind::Akp815 | Kind::MiraBoxHSV293S => { + Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::MiraBoxHSV293S => { let bytes = get_feature_report(&self.device, 0x01, 20)?; Ok(extract_str(&bytes[0..])?) } diff --git a/src/util.rs b/src/util.rs index 0ee12ca..71729b4 100644 --- a/src/util.rs +++ b/src/util.rs @@ -119,7 +119,7 @@ pub fn read_button_states(kind: &Kind, states: &[u8]) -> Vec { } match kind { - Kind::Akp153 | Kind::Akp153E | Kind::Akp815 | Kind::MiraBoxHSV293S => { + Kind::Akp153 | Kind::Akp153E | Kind::Akp153R | Kind::Akp815 | Kind::MiraBoxHSV293S => { let mut bools = vec![]; for i in 0..kind.key_count() {