0x4600 · crown Query and configure a rotary crown, then receive its diverted rotation, sensor, gesture, and button updates.
0x4600 controls the rotary crown on supported MX Master devices. It exposes capability and current-mode reads. It can change reporting, ratchet mode, and three timing values.
Spec: Logitech HID++ 2.0 — x4600 crown (v0). Used by: Not used by OpenLogi outside the typed openlogi-hidpp wrapper.
CrownFeature implements feature version 0.
Function HID++ fn Signature Returns get_info0 ()CrownInfoget_mode1 ()CrownModeset_mode2 (mode: SetCrownMode)()listenevent ()async_channel::Receiver<CrownEvent>
The first three methods are async and return Result<…, Hidpp20Error>. listen is synchronous.
Field Type Description controlsCrownControlCapabilitiesControl capability bits. sensorsCrownSensorCapabilitiesSensor capability bits. slotsu16Slots per revolution. ratchetsu16Ratchets per revolution.
Field Value Description BUTTON1 << 0The crown has a button. BUTTON_LONG_PRESS1 << 1The button reports long presses. MECHANIZED_RATCHET1 << 2The ratchet is mechanized. ROTATION_TIMEOUT_CONFIGURABLE1 << 3Rotation timeout is configurable. SHORT_LONG_TIMEOUT_CONFIGURABLE1 << 4Short-long timeout is configurable. DOUBLE_TAP_SPEED_CONFIGURABLE1 << 5Double-tap speed is configurable.
Field Value Description PROXIMITY1 << 0The crown has a proximity sensor. TOUCH1 << 1The crown has a touch sensor. TAP_GESTURE1 << 2The crown detects a tap. DOUBLE_TAP_GESTURE1 << 3The crown detects a double tap.
Field CrownMode typeSetCrownMode typeDescription divertingReportingModeOption<ReportingMode>Event reporting destination. ratchet_modeRatchetModeOption<RatchetMode>Free or ratchet rotation. rotation_timeoutu8Option<NonZeroU8>Timeout in 10 ms steps. short_long_timeoutu8Option<NonZeroU8>Press threshold in 10 ms steps. double_tap_speedu8Option<NonZeroU8>Double-tap speed in 10 ms steps.
None in SetCrownMode writes the protocol's zero no-change sentinel. The device clips rotation_timeout to 0x40. CrownMode rejects that sentinel and other unknown mode values.
Type Variant Value Description ReportingModeHid1Events go to native HID. ReportingModeDiverted2Events go to HID++. RatchetModeFree1Free rotation. RatchetModeRatchet2Detented rotation.
CrownFeature implements EmittingFeature<CrownEvent>. It accepts only event sub-ID 0.
Variant or field Type Description Update(CrownUpdate)CrownEventA crown update while reporting is diverted. rotation_stateRotationStateRotation lifecycle state. relative_slot_rotationi8Signed slot delta. relative_ratchet_rotationi8Signed ratchet delta. proximityActivityStateProximity lifecycle state. touchActivityStateTouch lifecycle state. gestureCrownGestureTouch gesture. buttonButtonStateButton lifecycle state. speedi16Signed slots per second.
Type Variants Values RotationStateInactive, Start, Active, Stop, Other(u8)0–3, otherActivityStateInactive, Start, Active, Stop, Other(u8)0–3, otherCrownGestureNone, Tap, DoubleTap, Other(u8)0–2, otherButtonStateInactive, Press, ShortPressActive, LongPress, LongPressActive, Release, Other(u8)0–5, other
Event enums preserve an unmodelled byte as Other(u8).
get_info and get_mode send three zero bytes. set_mode sends a 16-byte long payload. OpenLogi ignores response bytes not listed below.
Bytes Field Notes 0 controlsCrownControlCapabilities; unknown bits are retained.1 sensorsCrownSensorCapabilities; unknown bits are retained.2–3 slotsu16, BE.4–5 ratchetsu16, BE.6–15 — OpenLogi ignores these bytes.
Byte Field Notes 0 diverting1 = Hid; 2 = Diverted. 0 and other values are rejected.1 ratchet_mode1 = Free; 2 = Ratchet. 0 and other values are rejected.2 rotation_timeoutu8, 10 ms steps.3 short_long_timeoutu8, 10 ms steps.4 double_tap_speedu8, 10 ms steps.5–15 — OpenLogi ignores these bytes.
Byte Field Notes 0 divertingSome(Hid) = 1; Some(Diverted) = 2; None = 0.1 ratchet_modeSome(Free) = 1; Some(Ratchet) = 2; None = 0.2 rotation_timeoutNonZeroU8 value, or 0 for None.3 short_long_timeoutNonZeroU8 value, or 0 for None.4 double_tap_speedNonZeroU8 value, or 0 for None.5–15 — OpenLogi writes 0x00.
The protocol reply echoes the request bytes. OpenLogi does not decode it. Call get_mode to read the resulting mode.
Bytes Field Notes 0 rotation_stateRotationState, including Other(u8).1 relative_slot_rotationi8.2 relative_ratchet_rotationi8.3 proximityActivityState, including Other(u8).4 touchActivityState, including Other(u8).5 gestureCrownGesture, including Other(u8).6 buttonButtonState, including Other(u8).7–13 — OpenLogi ignores these bytes. 14–15 speedi16, BE.
No device-layer or agent path uses CrownFeature in v0.8.15. The typed wrapper exposes the feature for library consumers. It does not apply capability gates, read-modify-write logic, read-back checks, or session restoration.
use std :: num :: NonZeroU8 ;
use hidpp :: {
device :: Device ,
feature :: {
EmittingFeature ,
crown :: { CrownFeature , RatchetMode , ReportingMode , SetCrownMode },
},
};
// device: &mut Device, already created via Device::new(channel, index)
device . enumerate_features () .await? ;
if let Some (feature) = device . get_feature :: < CrownFeature >() {
feature
. set_mode ( SetCrownMode {
diverting : Some ( ReportingMode :: Diverted ),
ratchet_mode : Some ( RatchetMode :: Ratchet ),
rotation_timeout : Some ( NonZeroU8 :: new ( 10 ) . unwrap ()),
short_long_timeout : None ,
double_tap_speed : None ,
})
.await? ;
println! ( "{:?}" , feature . get_mode () .await? );
let receiver = feature . listen ();
while let Ok (event) = receiver . recv () .await {
println! ( "{event:?}" );
}
}