到戴尔官网下载驱动 https://www.dell.com/support/home/en-us/drivers/driversdetails?driverid=6wgwy

下载autohotkey https://www.autohotkey.com/

新建脚本

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

^F11::
    Run, "C:\Program Files (x86)\Dell\Dell Display Manager\ddm.exe" /1:SetActiveInput DP1
Return

^F12::
    Run, "C:\Program Files (x86)\Dell\Dell Display Manager\ddm.exe" /1:SetActiveInput HDMI
Return

/斜杠后面的数字是显示器的序号,有的情况下不能成功切换显示器,把后面参数1替换成2就可以了,目前不清楚序号的规律。

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

^F9::
    Run, "C:\Program Files (x86)\Dell\Dell Display Manager\ddm.exe" /1:SetActiveInput DP1
Return

^F10::
    Run, "C:\Program Files (x86)\Dell\Dell Display Manager\ddm.exe" /1:SetActiveInput HDMI
Return

^F11::
    Run, "C:\Program Files (x86)\Dell\Dell Display Manager\ddm.exe" /2:SetActiveInput DP1
Return

^F12::
    Run, "C:\Program Files (x86)\Dell\Dell Display Manager\ddm.exe" /2:SetActiveInput HDMI
Return

开机启动 把脚本放到下面位置 Win7

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

Win10

C:\Users\{{username}}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

参考:http://liubonan.com/2017/09/03/kuai-su-qie-huan-dellxian-shi-qi-shu-ru-yuan/