Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.

fix razer blade 2023 #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions librazer/src/descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct Descriptor {

pub const SUPPORTED: &[Descriptor] = &[
Descriptor {
model_number_prefix: "RZ09-0483T",
model_number_prefix: "RZ09-0483",
name: "Razer Blade 16” (2023) Black",
pid: 0x029f,
features: &[
Expand All @@ -24,7 +24,7 @@ pub const SUPPORTED: &[Descriptor] = &[
],
},
Descriptor {
model_number_prefix: "RZ09-0482X",
model_number_prefix: "RZ09-0482",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model_number_prefix is an entry from the list provided by Razor. According to it RZ09-0482X and RZ09-0482V are different models.

And they do different. They have a different set of supported features, e.g.

  • RZ09-0482X - Mercury and doesn't have a LED Logo on the lid
  • RZ09-0482V - Black and has Logo on the lid

I suggest adding extra entry to the SUPPORTED array. If there are cases where model_number_prefixes share common set of features, the model_number_prefix entry can be refactored into array.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok....
mine is ->
PS D:\source\repos\razer-ctl\target\debug> .\razer-cli.exe enumerate
Model: RZ09-0483S
Supported: true
PID: [
0x029f,
]

btw. i use RustRover to build the project.
with you exe file i also got the HID error. compiled with RustRover its works.
maybe it use newer/other libs ;)

and btw2 big thx for your work. i dont need synapse anymore. the only thing i miss is changing the color of the keyboard...

Copy link
Owner

@tdakhran tdakhran Oct 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

synapse is a nightmare 🌃.
changing keyboard colors was requested multiple times, but I believe it should be a standalone tool, as not everyone has Razer keyboard.

re: compilation issues, just did clean clone and ran

❯ cargo run --release --target x86_64-pc-windows-gnu --bin razer-cli enumerate
    Finished `release` profile [optimized] target(s) in 0.05s
     Running `target/x86_64-pc-windows-gnu/release/razer-cli.exe enumerate`
Model: RZ09-0483T
Supported: true
PID: [
    0x029f,
]

Feel free to add your model, RZ09-0483S, to the list of SUPPORTED, and PR is good to merge.

name: "Razer Blade 14” (2023) Mercury",
pid: 0x029d,
features: &[
Expand Down
2 changes: 1 addition & 1 deletion librazer/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl Device {

match SUPPORTED
.iter()
.find(|supported| model_number_prefix == supported.model_number_prefix)
.find(|supported| model_number_prefix.starts_with(supported.model_number_prefix))
{
Some(supported) => Device::new(supported.clone()),
None => anyhow::bail!(
Expand Down
2 changes: 1 addition & 1 deletion razer-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ fn enumerate() -> Result<()> {
"Supported: {}",
librazer::descriptor::SUPPORTED
.iter()
.any(|supported| model_number_prefix == supported.model_number_prefix)
.any(|supported| model_number_prefix.starts_with(supported.model_number_prefix))
);
println!("PID: {:#06x?}", pid_list);
Ok(())
Expand Down
Loading