OpenLogi

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.

Function reference

CrownFeature implements feature version 0.

Methods

FunctionHID++ fnSignatureReturns
get_info0()CrownInfo
get_mode1()CrownMode
set_mode2(mode: SetCrownMode)()
listenevent()async_channel::Receiver<CrownEvent>

The first three methods are async and return Result<…, Hidpp20Error>. listen is synchronous.

Types

CrownInfo

FieldTypeDescription
controlsCrownControlCapabilitiesControl capability bits.
sensorsCrownSensorCapabilitiesSensor capability bits.
slotsu16Slots per revolution.
ratchetsu16Ratchets per revolution.

CrownControlCapabilities

FieldValueDescription
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.

CrownSensorCapabilities

FieldValueDescription
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.

CrownMode and SetCrownMode

FieldCrownMode 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.

ReportingMode and RatchetMode

TypeVariantValueDescription
ReportingModeHid1Events go to native HID.
ReportingModeDiverted2Events go to HID++.
RatchetModeFree1Free rotation.
RatchetModeRatchet2Detented rotation.

Events

CrownFeature implements EmittingFeature<CrownEvent>. It accepts only event sub-ID 0.

CrownEvent and CrownUpdate

Variant or fieldTypeDescription
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.
TypeVariantsValues
RotationStateInactive, Start, Active, Stop, Other(u8)0–3, other
ActivityStateInactive, Start, Active, Stop, Other(u8)0–3, other
CrownGestureNone, Tap, DoubleTap, Other(u8)0–2, other
ButtonStateInactive, Press, ShortPressActive, LongPress, LongPressActive, Release, Other(u8)0–5, other

Event enums preserve an unmodelled byte as Other(u8).

Wire format

get_info and get_mode send three zero bytes. set_mode sends a 16-byte long payload. OpenLogi ignores response bytes not listed below.

get_info (fn 0)

BytesFieldNotes
0controlsCrownControlCapabilities; unknown bits are retained.
1sensorsCrownSensorCapabilities; unknown bits are retained.
2–3slotsu16, BE.
4–5ratchetsu16, BE.
6–15—OpenLogi ignores these bytes.

get_mode (fn 1)

ByteFieldNotes
0diverting1 = Hid; 2 = Diverted. 0 and other values are rejected.
1ratchet_mode1 = Free; 2 = Ratchet. 0 and other values are rejected.
2rotation_timeoutu8, 10 ms steps.
3short_long_timeoutu8, 10 ms steps.
4double_tap_speedu8, 10 ms steps.
5–15—OpenLogi ignores these bytes.

set_mode (fn 2)

ByteFieldNotes
0divertingSome(Hid) = 1; Some(Diverted) = 2; None = 0.
1ratchet_modeSome(Free) = 1; Some(Ratchet) = 2; None = 0.
2rotation_timeoutNonZeroU8 value, or 0 for None.
3short_long_timeoutNonZeroU8 value, or 0 for None.
4double_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.

CrownEvent::Update event (fn 0)

BytesFieldNotes
0rotation_stateRotationState, including Other(u8).
1relative_slot_rotationi8.
2relative_ratchet_rotationi8.
3proximityActivityState, including Other(u8).
4touchActivityState, including Other(u8).
5gestureCrownGesture, including Other(u8).
6buttonButtonState, including Other(u8).
7–13—OpenLogi ignores these bytes.
14–15speedi16, BE.

How OpenLogi uses it

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.

Usage (Rust)

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:?}");
    }
}

On this page