Skip to content
Merged
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
1 change: 1 addition & 0 deletions src/device/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ const needsOpenClasses = (): Array<ClientClass<SupportedClient> | undefined> =>
CM()?.MchoseHidClient, CM()?.MchoseDockHidClient, CM()?.MchoseA5ProMaxHidClient, CM()?.MchoseV3HidClient,
CM()?.MicrosoftHidClient, CM()?.DareuHidClient, CM()?.IncottHidClient, CM()?.BytechHidClient, CM()?.RapooHidClient,
CM()?.FaterHidClient, CM()?.CoolerMasterHidClient, CM()?.RedragonM690ProHidClient, CM()?.AjazzHidClient,
CM()?.HitscanHidClient,
];
const pulsarClasses = (): Array<ClientClass<PulsarClient> | undefined> =>
[CM()?.PulsarHidClient, CM()?.PulsarProHidClient, CM()?.PulsarXs1HidClient];
Expand Down
4 changes: 3 additions & 1 deletion src/device/driver-classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ export type DriverModules = typeof import("@openmouse/protocol/drivers/endgame/e
& typeof import("@openmouse/protocol/drivers/rapoo/hid")
& typeof import("@openmouse/protocol/drivers/coolermaster/hid")
& typeof import("@openmouse/protocol/drivers/ajazz/hid")
& typeof import("@openmouse/protocol/drivers/redragon/m690-pro-hid");
& typeof import("@openmouse/protocol/drivers/redragon/m690-pro-hid")
& typeof import("@openmouse/protocol/drivers/hitscan/hid");

let loaded: DriverModules | null = null;
let loading: Promise<DriverModules> | null = null;
Expand Down Expand Up @@ -143,6 +144,7 @@ export function ensureDriverModules(): Promise<DriverModules> {
import("@openmouse/protocol/drivers/coolermaster/hid"),
import("@openmouse/protocol/drivers/ajazz/hid"),
import("@openmouse/protocol/drivers/redragon/m690-pro-hid"),
import("@openmouse/protocol/drivers/hitscan/hid"),
]).then((mods) => (loaded = Object.assign({}, ...mods) as DriverModules));
return loading;
}
Expand Down
3 changes: 3 additions & 0 deletions src/device/traits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ const BY_FAMILY: Readonly<Record<string, Partial<DriverTraits>>> = {
// The NJ07/NJ08 family keeps the sleep timer in its config block and has no
// debounce setting in the vendor panel, so only the sleep card.
ajazz: { advancedSection: true, sleep: true },
// Hitscan stores a 0-8 ms debounce in flash and publishes its own ceiling.
// Its sleep units are unresolved, so the driver hides the sleep card.
hitscan: { advancedSection: true, debounce: true },
};

const BY_BRAND: Readonly<Record<string, string>> = {
Expand Down
10 changes: 10 additions & 0 deletions src/features/devices/cards/availability.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,16 @@ test("debounce is offered only by the families that store it", () => {
})).debounce, false);
});

test("the Hitscan family alone gives the advanced section and debounce, not sleep or signal", () => {
// No ui flags beyond the family, so the result comes from the traits entry.
const status = { brand: "Hitscan", ui: { family: "hitscan" }, debounceMs: 4, sleepTimeout: 60, signalStrength: 80 } as const;
const has = cardAvailability(snapshot({ status }));
assert.equal(traitsFor({ ...STATUS, ...status }).advancedSection, true);
assert.equal(has.debounce, true);
assert.equal(has.sleep, false);
assert.equal(has.signal, false);
});

test("low power needs the Razer capability, not merely a reported threshold", () => {
// selectableValues treats an empty option list as unbounded, so a mouse that
// reports a threshold without the Razer driver must not show the card.
Expand Down
Loading