@openmouse/protocol 0.12.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -113,6 +113,23 @@ export declare function supportsLiveLiftOffControl(legacyDpi: boolean, liftOffDi
113
113
  * probing remains the fallback for older devices that omit identity data.
114
114
  */
115
115
  export declare function isWiredHidppConnection(productId: number, transportIds: Record<string, string>, directIndex: boolean): boolean;
116
+ /**
117
+ * The connection wording the shell shows, or undefined for its default
118
+ * "2.4 GHz receiver" text.
119
+ *
120
+ * Usage page 0xFF43 is Bluetooth's HID++ page, but newer USB mice (the PRO X 3
121
+ * Superstrike, on its cable and on its Lightspeed receiver) put their USB
122
+ * interface there too, so the page alone cannot say "Bluetooth". A product id
123
+ * that is a known receiver or wired mouse is USB whatever page it uses. Only
124
+ * the label follows this; the transport paths still key off isBluetooth.
125
+ */
126
+ export declare function connectionDetailFor(connection: {
127
+ wired: boolean;
128
+ directConnect: boolean;
129
+ bluetoothPage: boolean;
130
+ knownUsbProduct: boolean;
131
+ boltReceiver: boolean;
132
+ }): string | undefined;
116
133
  export declare class LogitechHidppClient {
117
134
  private dpiOptionsCache;
118
135
  private dpiFeatureResolved;
@@ -125,6 +142,8 @@ export declare class LogitechHidppClient {
125
142
  /** Last format read from 0x8100, so a refusal can name it. */
126
143
  private profileFormatId;
127
144
  private wiredConnection;
145
+ /** The mouse's own reported USB transport id; keys per-product cable limits. */
146
+ private usbTransportId;
128
147
  /** Lift-off levels this device advertised; the single source of truth for both UI and validation. */
129
148
  private lodCapabilities;
130
149
  private supportedLods;
@@ -208,11 +227,31 @@ export declare class LogitechHidppClient {
208
227
  getDpiOptions(): Promise<number[]>;
209
228
  setDpi(dpi: number, dpiY?: number): Promise<number>;
210
229
  setLiftOffDistance(liftOffDistance: NonNullable<LogitechMouseStatus["liftOffDistance"]>): Promise<NonNullable<LogitechMouseStatus["liftOffDistance"]>>;
230
+ /**
231
+ * `rapidTriggerEnabled` switches rapid trigger on or off (the toggle G HUB
232
+ * labels "Schnellauslöser aktivieren"); left out, the button's current state
233
+ * is kept.
234
+ */
211
235
  setAnalogButtonTuning(button: 0 | 1, tuning: {
212
236
  actuation: number;
213
237
  rapidTrigger: number;
214
238
  haptics: number;
239
+ rapidTriggerEnabled?: boolean;
215
240
  }): Promise<void>;
241
+ private assertAnalogTuningInRange;
242
+ /**
243
+ * Saves HITS settings into the running profile, where the mouse reloads them
244
+ * at power-on. setAnalogButtonTuning alone only changes the working values,
245
+ * which a power cycle discards. Call it after the live write, with the same
246
+ * values, so both copies agree; both buttons go into one sector write.
247
+ */
248
+ persistAnalogButtonTuning(buttons: ReadonlyArray<{
249
+ button: 0 | 1;
250
+ actuation: number;
251
+ rapidTrigger: number;
252
+ haptics: number;
253
+ rapidTriggerEnabled?: boolean;
254
+ }>): Promise<void>;
216
255
  /**
217
256
  * Switches the mouse between running from profile flash and being driven live
218
257
  * by software. This is what G HUB's "Onboard Memory Mode" toggle does.
@@ -276,6 +315,13 @@ export declare class LogitechHidppClient {
276
315
  button: number;
277
316
  steps: LogitechMacroStep[];
278
317
  }>;
318
+ analogButtons?: ReadonlyArray<{
319
+ button: 0 | 1;
320
+ actuation: number;
321
+ rapidTrigger: number;
322
+ haptics: number;
323
+ rapidTriggerEnabled?: boolean;
324
+ }>;
279
325
  /** Defaults to the running profile when omitted. */
280
326
  sector?: number;
281
327
  }): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"hidpp.d.ts","sourceRoot":"","sources":["../../../src/drivers/logitech/hidpp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAYpE,OAAO,EAaL,KAAK,6BAA6B,EAoBlC,KAAK,iBAAiB,EA4BvB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,iBAAiB,EACjB,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,WAAW,CAAC;AACn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Probe, co
3
3
  import { LOGITECH_CHANGE_HOST, LOGITECH_FRIENDLY_NAME, LOGITECH_KEY_FLAG, LOGITECH_REPROG_CONTROLS, buildControlDiversionClearWrite, buildControlRemapWrite, decodeControlInfo, decodeControlReporting, logitechControlName, logitechTaskName, remappableControlTargets, LOGITECH_HAPTIC, LOGITECH_HAPTIC_EFFECTS, LOGITECH_HIRES_WHEEL, LOGITECH_HIRES_WHEEL_BIT, LOGITECH_HOSTS, LOGITECH_SMART_SHIFT, LOGITECH_SMART_SHIFT_LEGACY, LOGITECH_SMART_SHIFT_OFF, LOGITECH_THUMB_WHEEL, buildFriendlyNameWrite, buildRatchetControlWrite, buildThumbWheelWrite, decodeHiresWheelCapabilities, decodeHiresWheelMode, decodeRatchetControl, decodeThumbWheelStatus, decodeThumbWheelSupportsInvert, encodeHiresWheelMode, buildHostSwitchWrite, decodeFriendlyNameChunk, decodeFriendlyNameLengths, decodeFriendlyNameText, decodeHostPaired, decodeHostsInfo, rejectFriendlyName, rejectHostSwitch, buildHapticConfigWrite, decodeHapticConfig, encodeHapticFlags, isLogitechHapticEffect, isLogitechHapticIntensity, DEVICE_INDEX_DIRECT, decodeBatteryLevelState, decodeReportRateBitmap, decodeUnifiedBatteryState, hidppDeviceIndexCandidates, hidppErrorForRequest, isBoltReceiverProduct, isDirectConnectProduct, isDirectConnection, OnboardOnlyError, withSoftwareId, } from "@openmouse/protocol/logitech";
4
4
  export { collapseBoltPeers, hasHidppBluetoothCollection, hasHidppLongCollection, hasHidppShortCollection, } from "./bolt.js";
5
5
  import { MODE_STATUS, buildModeStatusWriteMany, decodeModeStatus, } from "./mode-status.js";
6
- import { ONBOARD_MODE, PROFILE_FN, PROFILE_NAME_MAX_CHARS, applyCrc, capabilitiesForFormat, decodeLiftOffLevel, decodeOnboardProfile, describeProfileFormat, dpiStageCapabilitiesForOptions, isProfileWritable, isLodWritableForProduct, encodeDpiStages, encodeButtonAssignment, encodeMacroButtonAssignment, encodeMacroSector, encodeProfileName, encodeReportRate, factoryProfileForFormat, validateDpiStagePlan, layoutForFormat, parseDirectory, parseProfilesInfo, profileCrc, reportRatesForDevice, setDirectoryEnabled, storedCrc, supportsProfileWriteProbe, validateBunnyHoppingMs, } from "./onboard-profiles.js";
6
+ import { ONBOARD_MODE, PROFILE_FN, PROFILE_NAME_MAX_CHARS, applyCrc, capabilitiesForFormat, decodeLiftOffLevel, decodeOnboardProfile, describeProfileFormat, dpiStageCapabilitiesForOptions, isProfileWritable, isLodWritableForProduct, encodeDpiStages, encodeAnalogButtons, encodeButtonAssignment, encodeMacroButtonAssignment, encodeMacroSector, encodeProfileName, encodeReportRate, factoryProfileForFormat, validateDpiStagePlan, layoutForFormat, parseDirectory, parseProfilesInfo, profileCrc, reportRateCapabilitiesFor, reportRatesForDevice, setDirectoryEnabled, storedCrc, supportsProfileWriteProbe, validateBunnyHoppingMs, } from "./onboard-profiles.js";
7
7
  import { encodeLogitechRgbEffect, encodeLogitechColorLedEffect, logitechColorLedLighting, logitechRgbLighting, } from "./rgb-effects.js";
8
8
  /**
9
9
  * Master switch for writing DPI slots into profile flash.
@@ -133,6 +133,25 @@ export function isWiredHidppConnection(productId, transportIds, directIndex) {
133
133
  return activeTransport === "USB";
134
134
  return directIndex;
135
135
  }
136
+ /**
137
+ * The connection wording the shell shows, or undefined for its default
138
+ * "2.4 GHz receiver" text.
139
+ *
140
+ * Usage page 0xFF43 is Bluetooth's HID++ page, but newer USB mice (the PRO X 3
141
+ * Superstrike, on its cable and on its Lightspeed receiver) put their USB
142
+ * interface there too, so the page alone cannot say "Bluetooth". A product id
143
+ * that is a known receiver or wired mouse is USB whatever page it uses. Only
144
+ * the label follows this; the transport paths still key off isBluetooth.
145
+ */
146
+ export function connectionDetailFor(connection) {
147
+ if (connection.wired || connection.directConnect)
148
+ return "Wired USB";
149
+ if (connection.bluetoothPage && !connection.knownUsbProduct)
150
+ return "Bluetooth";
151
+ if (connection.boltReceiver)
152
+ return "Logi Bolt";
153
+ return undefined;
154
+ }
136
155
  const BATTERY_VOLTAGE_CURVE = [
137
156
  [4186, 100], [4067, 90], [3989, 80], [3922, 70], [3859, 60],
138
157
  [3811, 50], [3778, 40], [3751, 30], [3717, 20], [3671, 10],
@@ -150,6 +169,8 @@ export class LogitechHidppClient {
150
169
  /** Last format read from 0x8100, so a refusal can name it. */
151
170
  profileFormatId = null;
152
171
  wiredConnection = false;
172
+ /** The mouse's own reported USB transport id; keys per-product cable limits. */
173
+ usbTransportId = null;
153
174
  /** Lift-off levels this device advertised; the single source of truth for both UI and validation. */
154
175
  lodCapabilities = capabilitiesForFormat(null);
155
176
  supportedLods = ["Medium", "High"];
@@ -471,6 +492,11 @@ export class LogitechHidppClient {
471
492
  this.supportedLods = [...this.lodCapabilities.supportedLods];
472
493
  const wired = isWiredHidppConnection(this.device.productId, identity.transportIds, this.isDirectConnect);
473
494
  this.wiredConnection = wired;
495
+ this.usbTransportId = identity.transportIds.USB ?? null;
496
+ this.lodCapabilities = {
497
+ ...this.lodCapabilities,
498
+ reportRates: reportRateCapabilitiesFor(onboardProfileFormat?.id, this.usbTransportId),
499
+ };
474
500
  // A direct-connect mouse keeps its rate in the onboard profile, so it can
475
501
  // only change once that format is verified and actually carries a
476
502
  // report-rate field. Anything else stays read-only.
@@ -560,13 +586,14 @@ export class LogitechHidppClient {
560
586
  // Without this the shell falls back to its "2.4 GHz receiver" wording,
561
587
  // which is wrong for a mouse plugged straight into USB, and imprecise
562
588
  // for Logi Bolt (BLE-based) versus Lightspeed.
563
- connectionDetail: this.isDirectConnect
564
- ? "Wired USB"
565
- : this.isBluetooth
566
- ? "Bluetooth"
567
- : this.isBoltReceiver
568
- ? "Logi Bolt"
569
- : undefined,
589
+ connectionDetail: connectionDetailFor({
590
+ wired,
591
+ directConnect: this.isDirectConnect,
592
+ bluetoothPage: this.isBluetooth,
593
+ knownUsbProduct: KNOWN_RECEIVER_PRODUCT_IDS.has(this.device.productId)
594
+ || isDirectConnectProduct(this.device.productId),
595
+ boltReceiver: this.isBoltReceiver,
596
+ }),
570
597
  activeProfile: profileState.activeProfile,
571
598
  deviceMode: profileState.deviceMode,
572
599
  unitId: identity.unitId,
@@ -889,6 +916,11 @@ export class LogitechHidppClient {
889
916
  }
890
917
  return result;
891
918
  }
919
+ /**
920
+ * `rapidTriggerEnabled` switches rapid trigger on or off (the toggle G HUB
921
+ * labels "Schnellauslöser aktivieren"); left out, the button's current state
922
+ * is kept.
923
+ */
892
924
  async setAnalogButtonTuning(button, tuning) {
893
925
  const feature = await this.getFeature(FEATURE.analogButtons);
894
926
  if (!feature.index) {
@@ -899,26 +931,54 @@ export class LogitechHidppClient {
899
931
  if (!capabilities) {
900
932
  throw new Error("This mouse does not expose tuning for that button.");
901
933
  }
902
- if (!Number.isInteger(tuning.actuation) || tuning.actuation < 1 || tuning.actuation > current.maxActuation
903
- || !Number.isInteger(tuning.rapidTrigger) || tuning.rapidTrigger < 1 || tuning.rapidTrigger > current.maxRapidTrigger
904
- || !Number.isInteger(tuning.haptics) || tuning.haptics < 0 || tuning.haptics > current.maxHaptics) {
905
- throw new Error("One or more hall-effect button values are outside the mouse's supported range.");
906
- }
907
- // HID++ 0x1B0C stores logical values in bits 7..2. Bit 0 of rapid trigger
908
- // is a firmware-managed sensitivity flag, so it must survive the write.
934
+ this.assertAnalogTuningInRange(current, tuning);
935
+ // HID++ 0x1B0C stores logical values in bits 7..2. In the rapid-trigger byte,
936
+ // bit 0 is the on/off switch: G HUB's toggle flips it (0x08 off, 0x09 on at
937
+ // sensitivity 2, captured from a PRO X 3 Superstrike). A write that does not
938
+ // name a state keeps the current one.
909
939
  const currentWire = await this.request(feature.index, 0x20, button);
940
+ const enabledBit = tuning.rapidTriggerEnabled === undefined
941
+ ? (currentWire[5] ?? 0) & 0x01
942
+ : tuning.rapidTriggerEnabled ? 1 : 0;
910
943
  await this.requestLong(feature.index, 0x10, [
911
944
  button,
912
945
  tuning.actuation << 2,
913
- (tuning.rapidTrigger << 2) | ((currentWire[5] ?? 0) & 0x01),
946
+ (tuning.rapidTrigger << 2) | enabledBit,
914
947
  tuning.haptics << 2,
915
948
  ]);
916
949
  const confirmed = await this.readAnalogButtonTuning(feature.index);
917
950
  const result = confirmed.buttons[button];
918
- if (!result || result.actuation !== tuning.actuation || result.rapidTrigger !== tuning.rapidTrigger || result.haptics !== tuning.haptics) {
951
+ if (!result || result.actuation !== tuning.actuation || result.rapidTrigger !== tuning.rapidTrigger || result.haptics !== tuning.haptics
952
+ || (tuning.rapidTriggerEnabled !== undefined && result.rapidTriggerEnabled !== tuning.rapidTriggerEnabled)) {
919
953
  throw new Error("The mouse did not confirm the hall-effect button settings.");
920
954
  }
921
955
  }
956
+ assertAnalogTuningInRange(limits, tuning) {
957
+ if (!Number.isInteger(tuning.actuation) || tuning.actuation < 1 || tuning.actuation > limits.maxActuation
958
+ || !Number.isInteger(tuning.rapidTrigger) || tuning.rapidTrigger < 1 || tuning.rapidTrigger > limits.maxRapidTrigger
959
+ || !Number.isInteger(tuning.haptics) || tuning.haptics < 0 || tuning.haptics > limits.maxHaptics) {
960
+ throw new Error("One or more hall-effect button values are outside the mouse's supported range.");
961
+ }
962
+ }
963
+ /**
964
+ * Saves HITS settings into the running profile, where the mouse reloads them
965
+ * at power-on. setAnalogButtonTuning alone only changes the working values,
966
+ * which a power cycle discards. Call it after the live write, with the same
967
+ * values, so both copies agree; both buttons go into one sector write.
968
+ */
969
+ async persistAnalogButtonTuning(buttons) {
970
+ const feature = await this.getFeature(FEATURE.analogButtons);
971
+ if (!feature.index) {
972
+ throw new Error("This Logitech mouse does not expose hall-effect button tuning.");
973
+ }
974
+ const current = await this.readAnalogButtonTuning(feature.index);
975
+ for (const entry of buttons) {
976
+ if (!current.buttons[entry.button])
977
+ throw new Error("This mouse does not expose tuning for that button.");
978
+ this.assertAnalogTuningInRange(current, entry);
979
+ }
980
+ await this.writeActiveProfile({ analogButtons: buttons });
981
+ }
922
982
  /**
923
983
  * Switches the mouse between running from profile flash and being driven live
924
984
  * by software. This is what G HUB's "Onboard Memory Mode" toggle does.
@@ -1180,19 +1240,19 @@ export class LogitechHidppClient {
1180
1240
  // The two links are stored separately, so each is set on its own.
1181
1241
  if (values.reportRateWirelessHz) {
1182
1242
  const liveRates = await this.getSupportedPollingRateOptions();
1183
- const allowed = reportRatesForDevice(capabilitiesForFormat(formatId).reportRates, "wireless", liveRates, this.wiredConnection ? "wired" : "wireless", formatId < 6);
1243
+ const allowed = reportRatesForDevice(reportRateCapabilitiesFor(formatId, this.usbTransportId), "wireless", liveRates, this.wiredConnection ? "wired" : "wireless", formatId < 6);
1184
1244
  if (!allowed.includes(values.reportRateWirelessHz)) {
1185
1245
  throw new Error("The connected mouse did not advertise that profile report rate.");
1186
1246
  }
1187
- updated = encodeReportRate(updated, formatId, "wireless", values.reportRateWirelessHz);
1247
+ updated = encodeReportRate(updated, formatId, "wireless", values.reportRateWirelessHz, reportRateCapabilitiesFor(formatId, this.usbTransportId));
1188
1248
  }
1189
1249
  if (values.reportRateWiredHz) {
1190
1250
  const liveRates = await this.getSupportedPollingRateOptions();
1191
- const allowed = reportRatesForDevice(capabilitiesForFormat(formatId).reportRates, "wired", liveRates, this.wiredConnection ? "wired" : "wireless", formatId < 6);
1251
+ const allowed = reportRatesForDevice(reportRateCapabilitiesFor(formatId, this.usbTransportId), "wired", liveRates, this.wiredConnection ? "wired" : "wireless", formatId < 6);
1192
1252
  if (!allowed.includes(values.reportRateWiredHz)) {
1193
1253
  throw new Error("The connected mouse did not advertise that profile report rate.");
1194
1254
  }
1195
- updated = encodeReportRate(updated, formatId, "wired", values.reportRateWiredHz);
1255
+ updated = encodeReportRate(updated, formatId, "wired", values.reportRateWiredHz, reportRateCapabilitiesFor(formatId, this.usbTransportId));
1196
1256
  }
1197
1257
  if (values.name !== null && values.name !== undefined) {
1198
1258
  updated = encodeProfileName(updated, formatId, values.name);
@@ -1200,6 +1260,9 @@ export class LogitechHidppClient {
1200
1260
  for (const assignment of values.buttonAssignments ?? []) {
1201
1261
  updated = encodeButtonAssignment(updated, formatId, assignment.layer, assignment.button, assignment.binding);
1202
1262
  }
1263
+ if (values.analogButtons?.length) {
1264
+ updated = encodeAnalogButtons(updated, formatId, values.analogButtons);
1265
+ }
1203
1266
  applyCrc(updated);
1204
1267
  // Encoding is deterministic, so an identical result means nothing changed
1205
1268
  // and the write cycle can be skipped entirely.
@@ -2522,6 +2585,7 @@ export class LogitechHidppClient {
2522
2585
  actuation: (reply[4] ?? 0) >> 2,
2523
2586
  rapidTrigger: (reply[5] ?? 0) >> 2,
2524
2587
  haptics: (reply[6] ?? 0) >> 2,
2588
+ rapidTriggerEnabled: ((reply[5] ?? 0) & 0x01) === 1,
2525
2589
  });
2526
2590
  }
2527
2591
  return { maxActuation, maxRapidTrigger, maxHaptics, buttons };