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:
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.
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:
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
- Order: the keyboard and mouse are sent away first, and the monitor is set next, even if a device failed. Only then does the app check the devices.
- The shortcut itself: on Windows, a switch from a hotkey waits 400 ms so your keys are released before the keyboard leaves.
- macOS permissions: opening a keyboard or mouse needs Input Monitoring, even just to send it a command. Running from a terminal would charge that permission to the terminal, so
--switchforwards the request to the running app. - One at a time: switching and scanning share one lock, so they never talk to the hardware at once.
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:
What it can't do yet
- Keyboards and mice must be Logitech devices with Easy-Switch.
- Bluetooth is tested. Unifying and Bolt receivers are supported in code but untested.
- A Mac needs Apple Silicon to talk to the monitor.
- Each computer you want to switch away from needs the app, and the devices must be paired with it.
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.