Utility to work with the integrated hardware KVM switch of modern monitors.
Currently the focus of this tool is the DELL U4919DW
The tool consists of two components
- KVM Util: python based tool to send commands to the KVM switch and control it
- MonitorTool Hook: reverse engineering tool for Windows closed source tools of the monitor manufacturers. It allows to spy on them to gather the VCP commands they write and read on the display
Installed Python 3 of course.
- installed external python package monitorcontrol (see to https://monitorcontrol.readthedocs.io/en/latest/ & https://github.com/newAM/monitorcontrol):
pip3 install monitorcontrol
- External git repository cloned into
kvm\ddcci
- Installed Python package python-smbus
pip3 install smbus
- Installed ddcutil for
pbpswitch
commands (see https://www.ddcutil.com)sudo apt-get install ddcutil
- User must have access to the i2c devices
/dev/i2c-X
: e.g. add user to group i2c
First determine the device ID of the display. You can use
ddccontrol -p
on Linux. On Windows it's the 0-based index of the attached monitors.
Get the src folder, navigate to src\kvmutil and execute kvmutil.py.
kvmutil.py [-h] deviceid {inputselect,pbp,pbpsubinputselect,pbpswitch,pbpswitch2,pbpswap} ...
In the sub folders of kvmutil
there are some examples of real usages of the tool in Windows (kvmutil\win
) and Linux (kvmutil\linux
)
The tool is written in C# and uses the EasyHook framework (see https://easyhook.github.io/).
You can download the latest/nightly build: https://raw.githubusercontent.com/ScriptGod1337/kvm/master/downloads/MonitorToolHook.7z
Usage: Monitor.exe MonitorToolToSpy
For example for DELL Monitor.exe "C:\Program Files (x86)\Dell\Dell Display Manager\ddm.exe"
Important: the monitor must be the parent process of the program to hook - e.g. by doing a fresh start of it. This means close Dell Display Manager prior starting the monitor
The monitor logs the VCP commands send by the program to the console. You can execute a functionality of the monitor manufacture tool and find out which VCP command with which parameter was written or read
Monitor.exe "C:\Program Files (x86)\Dell\Dell Display Manager\ddm.exe"
...
**read OK GetVCPFeatureAndVCPFeatureReply_Hook 0x0 0xE5 0x0 0xFF
**read OK GetVCPFeatureAndVCPFeatureReply_Hook 0x0 0xE7 0xFF20 0xFFAA
**read OK GetVCPFeatureAndVCPFeatureReply_Hook 0x0 0xE8 0x12 0xFFFF
**read OK GetVCPFeatureAndVCPFeatureReply_Hook 0x0 0xE9 0x0 0xFF
...
**write SetcVCPFeature 0x0 0xE9 0x24
...
These values can be used in the KVM Util or in custom scripts
- Download the code or clone the repo
- Copy the EasyHook dll's over from the download linked above into the
src\MonitorToolHook\Monitor
folder - Open the solution file
- Go to the properties page of
Monitor.csproj
and add the location ofddm.exe
to the Debug settings 'command line arguments':"C:\Program Files (x86)\Dell\Dell Display Manager\ddm.exe"
- Run the Monitor project (set as startup project)