How it works

How one shortcut moves a whole desk

A monitor, a keyboard and a mouse can each change computer by themselves. They only need to be asked at the same moment, and that is all SwitchDesk does.

There is no KVM box and no USB switch, and nothing has to run on the computer you switch to. This page covers what the app actually sends to each device.

Keyboard and mouse: HID++

Logitech's Easy-Switch button picks one of the computers a device is paired with. Software can do the same through HID++, Logitech's protocol, where feature 0x1814, Change Host, handles it.

Finding the right door takes some care. HID++ isn't the device's primary HID usage. Over Bluetooth LE it sits on usage page 0xFF43, and over USB on 0xFF00.

Feature numbers vary by device, so the app asks first. A request to index 0 with the feature id 0x1814 returns that device's index for it. A device asleep on Bluetooth can miss that first packet, so the lookup gets a second try.

After that there are two calls: function 0 reads the current channel and the channel count, and function 1 sets the channel. The set request is a 20-byte report, padded with zeros:

0x11 # long report
0xFF # device index, for a direct connection
<index> # the number the device gave for 0x1814
0x1N # function 1, with a software id in N
<channel> # counted from 0

Success looks like silence

The set request never gets a reply, because the device drops the connection at once. So the usual check, waiting for an answer, can't work.

Instead the app asks the device for its channel half a second later. No answer, or the new channel, means it left. An answer from the old channel means it ignored the request, so the app sends it again, up to three requests in total.

Every switch is logged per device, for example moved from channel 1 to channel 2 on request 2. That log is how you tell a slow device from a stuck one.

Send each device to its new channel Set the monitor to its new input Wait half a second, ask for the channel Old channel? Third request? Send the request again Report: still here Moved yes no yes no answer, or the new channel

The monitor: DDC/CI

Display cables carry a small control channel next to the picture. DDC/CI runs over it, and VCP code 0x60 selects the input.

On Windows this is a public API: SetVCPFeature in dxva2.dll, with code 0x60 and the input value.

macOS has no public API for it. On Apple Silicon, IOKit contains IOAVServiceWriteI2C and related functions that aren't in its headers, the same ones m1ddc and MonitorControl use. The app looks them up with dlsym at run time, so it still starts where they are missing, such as on an Intel Mac.

The Mac app then builds the packet itself and writes it to chip address 0x37, data address 0x51:

0x84 0x03 0x60 <value high> <value low> <checksum>

The checksum is an XOR over the packet and the addresses. The Mac app sends the packet twice, because monitors often miss the first one.

Monitors disagree about numbers

The MCCS standard names the input values, but not every monitor follows it. On the DGOLED49, 15 is USB-C and 16 is DisplayPort, which isn't what MCCS says.

That's why SwitchDesk has hardware profiles: small JSON files that give a monitor's values their real names. Without a profile it still works, and you pick the value your monitor uses.

Reading is less reliable than writing. Many monitors don't answer on an input they aren't showing, and the DGOLED49 doesn't answer reads over HDMI. So a switch never depends on a monitor's reply. On Windows the app logs the value it reads back, and on macOS the current input is often unknown.

Small things that matter

The same switch works from a shortcut, the menu, or a command, which takes an id, a name, an alias or a unique part of one:

SwitchDesk --switch "my mac"

What it can't do yet

SwitchDesk is free for Mac and Windows. If it works or fails on your hardware, Settings, Hardware, Submit this hardware sends the details. No account is needed.