前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >使用autohotkey定制windows 10 虚拟桌面的快捷键

使用autohotkey定制windows 10 虚拟桌面的快捷键

作者头像
lcyw
发布2022-06-10 19:31:27
1.6K0
发布2022-06-10 19:31:27
举报
文章被收录于专栏:machh的专栏machh的专栏

Win10没有提供修改虚拟桌面快捷键的功能,默认的快捷键win+tab 打开虚拟桌面列表之后,还需要手动点击某个虚拟桌面才能进行切换,不是很方便,

所以我们使用AHK软件来自定义快捷键 ,通过自定义的快捷键快速的在多个虚拟桌面之间进行切换,

所需工具: AHK(AutoHotkey) 工具说明:键盘,鼠标等的脚本模拟工具,可以监听,触发键盘和鼠标的动作。 下载: https://www.autohotkey.com/download/

如何创建脚本参考官方说明:

How to create a script

  1. Right-Click on your desktop. 右键点击桌面
  2. Find "New" in the menu. 弹出菜单中选择“新建”
  3. Click "AutoHotkey Script" inside the "New" menu. 点击AutoHotkey Script子菜单
  4. Give the script a new name. It must end with a .ahk extension. 重命名文件
  5. Find the newly created file on your desktop and right-click it. 右键点击刚才创建的文件
  6. Click "Edit Script". 在菜单中点击Edit Script
  7. A window should have popped up, probably Notepad. If so, SUCCESS! 弹出编辑窗口,可能是记事本
  8. Save the File. 保存脚本文件
  9. Double-click the file/icon in the desktop to run it. 双击脚本文件,运行

参考脚本:

代码语言:javascript
复制
; Windows 10 虚拟桌面自动切换 
	!1::
	send #{Tab} 
	Return 
	!F2::
	send #^{right} 
	return 
	!F1::
	send #^{left}
	return 
	#2:: 
	{ 
		DetectHiddenWindows, on 
		if WinExist("ahk_exe idea64.exe") 
			WinActivate, ahk_class SunAwtFrame 
		else 
			Run, idea64.exe
	} 
	return
	; ---------------------------------------------------- 
	#1:: 
	{
		DetectHiddenWindows, on 
			if WinExist("ahk_exe notepad++.exe") 
				WinActivate, notepad++ 
			else 
				Run, notepad++.exe 
	} 
	return
	; ----------------------------------------------------
	#3:: 
	{ 
		DetectHiddenWindows, on 
			if WinExist("ahk_exe WeChat.exe")
				WinActivate, ahk_class WeChatMainWndForPC
			else 
				Run, WeChat.exe 
	} 
	return
	; ----------------------------------------------------
	#c:: 
	{ 
		DetectHiddenWindows, on 
			if WinExist("ahk_exe chrome.exe") 
				WinActivate, ahk_class Chrome_WidgetWin_1 
			else 
				Run, chrome.exe
	} 
	return
	; ---------------------------------------------------- 
	#b:: 
	{ 
		DetectHiddenWindows, on 
			if WinExist("ahk_exe BCompare.exe") 
				WinActivate, ahk_class TViewForm.UnicodeClass 
			else 
				Run, BCompare.exe
	}
	return
	;------------------------------------------

脚本说明:

alt+1 显示任务视图(所有桌面) alt+F1 上一个桌面 alt+F2 下一个桌面 替代默认win+数字的功能,具体可自定义, win+1 激活钉钉 win+2 激活IDEA win+3 激活微信 win+c 激活chrome win+b 激活beyondcompare

如想要修改,只需编辑脚本文件,替换想应的应用程序名即可。

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2018-05-30,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 音视频开发训练营 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云桌面
云桌面(Cloud Virtual Desktop,CVD),为您提供随需快捷交付的虚拟远程桌面服务。云桌面可以帮助您轻松构建安全的数字化工作空间,满足移动办公、安全开发、教育实训、在线设计等场景需求,提升业务访问的安全性和连续性。通过自适应传输协议,终端用户可以获得优质的云桌面访问体验。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档