How to switch your monitor's input with a keyboard shortcut
Last checked:
You don't have to reach for the buttons under the bezel. Nearly every modern monitor speaks DDC/CI, a VESA standard that lets software talk to the monitor over the video cable it's already plugged into. One of the things it can say is "show the other input." Here's how it works and the tools that do it.
The short answer
DDC/CI (Display Data Channel / Command Interface) carries small commands from your computer to your
monitor over the existing HDMI, DisplayPort, or USB-C cable. The commands are defined by the VESA
Monitor Control Command Set (MCCS), and VCP code 0x60 is Input Select.
Write a value to it and the monitor switches to that input, exactly as if you'd pressed its physical
buttons. So any software that can send that command can flip your monitor between two computers, and
you can bind that to a keyboard shortcut.
That's the whole trick. The rest is choosing how you want to trigger it.
What actually travels over the cable
Every HDMI, DisplayPort, DVI and VGA connector carries a slow two-wire I2C bus alongside the video
lanes. It is there so the computer can read the monitor's EDID at plug-in. DDC/CI reuses that same bus
in the other direction: the computer writes a short packet to I2C address 0x37 and the
monitor's scaler chip acts on it.
The packet that changes a setting is a Set VCP Feature request. It carries one feature code
(0x60 in this case) and a two-byte value. MCCS defines no reply for it, so nothing reports
success and nothing reports failure. The only way to find out what happened is to send a
Get VCP Feature request for the same code afterwards and read the value back. The gap between "the
command went out" and "the input changed" is where most DDC/CI trouble lives.
The capabilities string
A monitor will also tell you what it supports, if you ask. The capabilities string is a block of ASCII the monitor returns on request, listing its MCCS version, the VCP codes it implements and, for a non-continuous code like Input Select, the values it will accept. The relevant fragment looks like this:
vcp(02 04 05 08 10 12 14 16 18 1A 52 60(0F 11 12) AC AE B6 C0 C6 C8 CA DF)
The piece that matters is 60(0F 11 12): this panel claims Input Select and says it will take
DisplayPort 1, HDMI 1 and HDMI 2. If 60 is absent from the list, the monitor is telling you it
does not do input switching at all. If it is present, you have a starting point rather than a guarantee, for
reasons the caveats below go into.
The input values
MCCS defines the values, so they are the same on most monitors:
0x01VGA 1,0x03DVI 1,0x04DVI 20x0FDisplayPort 1,0x10DisplayPort 20x11HDMI 1,0x12HDMI 20x1B(27 in decimal) for USB-C on many panels, though that one is not in the MCCS list and vendors do not all agree on it
Reading 0x60 back with each input on screen gives you your own monitor's real numbering.
Option 1: The monitor's own buttons (free, clunky)
Every monitor ships with this: press the OSD buttons, navigate the on-screen menu, pick the input. It's free and it always works, but it means physically reaching under or behind the panel, and the menus on most monitors take four or five presses to get to the input list. Fine once a day; tedious if you swap between a work laptop and a desktop all day long.
Option 2: Free command-line tools and scripts (great for tinkerers)
Because DDC/CI is an open standard, there's a healthy ecosystem of free tools that can write VCP
code 0x60. If one computer is all you need to move the screen from, one of these is probably
the whole answer, and it costs nothing.
Linux: ddcutil
ddcutil is the reference implementation and the tool other projects get checked against. Four commands cover the job:
lists the monitors it can reach, with the display number for each.ddcutil detect
prints the capabilities string described above.ddcutil capabilities
reads the current input. The reply is a line likeddcutil getvcp 60VCP 60 SNC x0f.
switches to that input. Values take a leadingddcutil setvcp 60 0x0fxor0xfor hex, or plain decimal.
With more than one monitor attached, add --display 2 (numbering starts at 1, and the first
display is used if you say nothing).
macOS: BetterDisplay, Lunar, m1ddc, ddcctl
BetterDisplay covers the most hardware, Intel Macs and built-in HDMI ports included. Its CLI addresses VCP codes by name or number:
betterdisplaycli get -namelike=displayname -ddc -vcp=inputSelectbetterdisplaycli set -namelike=displayname -ddc -vcp=inputSelect -value=17
m1ddc is a small
command-line tool from the same author, Apple silicon only. Use m1ddc display list to find the
display number, then m1ddc display 1 set input 17 to switch to HDMI 1. It takes decimal here:
15 is DisplayPort 1, 17 is HDMI 1, 27 is USB-C. Its get command covers luminance, contrast,
colour gains and volume but not input, so you cannot read the input back with m1ddc alone, and some LG
panels need set input-alt with a different set of values.
Lunar also does input switching and exposes
it to both its CLI and macOS Shortcuts, which is the quickest route to a hotkey without writing code.
ddcctl still works
(ddcctl -d 1 -i 17 sets display 1 to HDMI 1) and is the usual answer on older Intel Macs,
though its author describes the project as being in maintenance mode.
One correction, because it comes up constantly: MonitorControl does not switch inputs. Brightness, volume and contrast over DDC is the whole feature list.
Windows: ControlMyMonitor, ddcswitch
NirSoft's free ControlMyMonitor is a single executable with no installer. It shows every VCP code the monitor reports and can be driven from a batch file or a shortcut:
ControlMyMonitor.exe /SetValue Primary 60 17
which returns the value inControlMyMonitor.exe /GetValue "\\.\DISPLAY1\Monitor0" 60%errorlevel%
ddcswitch is a newer
open-source option with a friendlier interface. ddcswitch list shows every DDC/CI-capable
monitor and its current input, ddcswitch get 0 input reads one back, and
ddcswitch set "LG ULTRAGEAR" HDMI2 switches by monitor and input name rather than raw hex.
Putting it on a key
None of these tools bring a hotkey of their own, so you supply one:
- On macOS, Hammerspoon is the
usual choice. A line like
inhs.hotkey.bind({"ctrl","alt"}, "q", function() hs.execute("/opt/homebrew/bin/m1ddc set input 17") end)~/.hammerspoon/init.luais the whole binding. - On Windows, AutoHotkey calling ControlMyMonitor or ddcswitch, or a plain shortcut file with a hotkey set in its properties.
- If you already own a USB switch for your keyboard and mouse,
display-switch takes
a different route. It watches for a USB device appearing or disappearing and sends the DDC command in
response, so the button on the USB switch moves the screen too. It runs on macOS, Windows and Linux and is
configured with a short ini file (
usb_device = "1050:0407",on_usb_connect = "Hdmi1").
The free route is a real route, and worth taking if you enjoy this sort of thing. What you take on is the assembly: finding your monitor's input values, writing the script, binding the key, then doing it again on the second computer. The other limit is shared by every tool on this page. They move the picture only. After the switch your keyboard and mouse are still attached to the computer you just switched away from, so you need a USB switch, a second set of peripherals, or keyboard-sharing software alongside them.
Option 3: EasyKVM (one hotkey, and your keyboard follows)
EasyKVM is a software KVM switch for Mac and Windows built around exactly this DDC/CI trick, plus the part the scripts leave out. Press a global hotkey (default Ctrl+Alt+Q, works from either machine) and it switches the monitor's input over DDC/CI and hands your keyboard, mouse, and audio to the other computer over your LAN. Press it again to come back. No input values to look up, no scripts to maintain, no USB switch.
- Install EasyKVM on both computers (macOS 13+ and Windows 10/11).
- Pair them once with a 6-digit code over your LAN. No account needed.
- Plug each computer into its own input on the monitor (HDMI, DisplayPort, or USB-C).
- Press the hotkey. The monitor flips, and your keyboard and mouse now drive the other machine.
The parts that take longest to get right by hand are handled in the background. It reads the input back after writing it instead of assuming the write landed, translates the private input numbering used by some MSI panels, and when the monitor will only take commands from the input it is currently showing, asks the computer that is on screen to perform the switch.
Caveats: read before you rely on DDC/CI
DDC/CI input switching works on most modern monitors, but not all, and the failure modes are specific enough to be worth knowing before you blame a cable.
It is often switched off, and it can switch itself back off
Plenty of panels ship with DDC/CI disabled. It is usually a single line in a settings or OSD submenu, labelled "DDC/CI" or sometimes "Smart Control". This is the most common reason nothing happens.
The version that wastes an afternoon: on some monitors the setting does not survive a loss of power. Use a switched socket or pull the plug overnight and the monitor comes back with DDC/CI disabled again. If switching worked yesterday and does nothing today, check the menu first.
Only the input on screen is listening
Most panels accept DDC/CI commands only on the input they are currently displaying. The other input's I2C channel is physically there, but the scaler ignores what arrives on it.
That makes the two directions of a swap completely different problems. Switching away is easy: the machine sending the command is the one on screen. Switching back is the hard direction, because the machine you want to return to sits on an input the monitor has stopped paying attention to. The fix is to send the command from whichever machine is currently on screen, which means the two computers need a way to talk to each other.
Some monitors don't use the values they advertise
The capabilities string is a claim, not a contract. Several MSI monitors built on MStar scalers list the
standard Input Select values and then use a private numbering internally: HDMI 1 is 0x05,
HDMI 2 is 0x06, DisplayPort 1 is 0x07, DisplayPort 2 is 0x08. Write
the standard 0x11 for HDMI 1 to one of these and the monitor takes the command without
complaint and does nothing with it.
If your monitor reports Input Select, appears to accept writes, and never moves, try the low values before concluding the feature is missing.
An acknowledged command is not a completed command
Because Set VCP Feature has no reply, a tool that reports success is usually reporting only that it managed
to write to the I2C bus. Every problem above looks identical from the sending side: a clean write and a
screen that does not change. Reading 0x60 back after the write is the only check that means
anything.
Cables, docks and timing
- Docks and adapters can block the channel. USB-C docks, hubs and some DisplayPort adapters don't pass the I2C channel through. If the monitor is behind one, try a direct DisplayPort or HDMI cable before deciding the monitor is at fault.
- The switch isn't instant. Panels take a moment to re-sync after changing input, and a second or two of black screen is normal. Give a read-back a short delay or it will report the old input and you'll chase a failure that isn't there.
- Input switching is its own capability. A monitor can accept brightness commands over
DDC/CI and still ignore writes to Input Select. Check whether
60appears at all in whatddcutil capabilities(or the tool's equivalent) reports.
If your monitor turns out not to support input switching, EasyKVM still works as a keyboard + mouse + audio switch. Turn off "Swap monitor input on hotkey" and change the input yourself. The troubleshooting page covers the common DDC/CI failure modes in more detail.
FAQ
Does my monitor support DDC/CI input switching?
0x60) is a separate question, though. A monitor can accept
brightness commands over DDC/CI and still ignore input-switch commands. A free tool like ddcutil
(Linux), ControlMyMonitor (Windows), or BetterDisplay (macOS) will tell you in minutes, and so
will EasyKVM's 3-day trial.
Can I switch monitor input without a KVM switch?
Does this work on both Mac and Windows?
Why isn't my monitor switching?
Why can I switch away from a computer but not back to it?
My monitor accepts the command but the input doesn't change. Why?
0x05 rather than
0x11. Reading code 0x60 back after writing it tells these apart.
What is VCP code 0x60?
0x60 tells the monitor which input to display: each HDMI, DisplayPort, and USB-C
port has its own value. It's the same switch the monitor's physical buttons flip, just triggered
over the video cable instead.
Can I switch monitor input without pressing the buttons?
0x60 changes the
input on most of them. Free tools such as ddcutil (Linux), BetterDisplay or m1ddc (macOS) and
ControlMyMonitor (Windows) send that command from the computer. DDC/CI may need to be switched on in
the monitor's on-screen menu first.
How do I swap the monitor between two computers with one key?
Try it on your own monitor
The fastest way to find out whether your monitor plays along is to run the 3-day trial: no credit card, full functionality, and it tells you within minutes whether DDC/CI input switching works on your exact panel. If it doesn't, there's a 14-day no-questions refund.
One-time payment · 3-day free trial · 14-day refund, no questions