2015-06-01 49 views
2

有没有人试图修复Labview干扰使用Autohotkey的正常Alt-Tab行为的方式?使用Autohotkey修复Labview Alt-Tab行为

Alt-Tab Labview将所有非labview窗口放到列表的末尾。

所以,如果你刚才从您的浏览器ALT-标签LabVIEW的窗口,它需要

(2×number_of_currently_open_labview_projects -1)

按键回去。

回答

1

好主意。我发现这个功能令人讨厌,而且在网络上的任何地方似乎都不是一个简单的修复方法。这是我的脚本。两个快速注释:

  • 我有很多麻烦重新映射Alt-Tab。如果这很关键,你可以尝试从here寻求帮助。
  • 据我所知,摆脱“屏幕闪烁”是不可能的,因为Windows在击键之间需要一些延迟。

注:为适应此代码为各种Windows - 查找“ahk_class”使用包含在AutoHotkey的installer窗口间谍工具。

代码

#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. 
#NoTrayIcon 
#SingleInstance force 

SetTitleMatchMode 2 ;partial search mode 
#IfWinActive vi 
#q:: ;there were issues mapping to Alt+Tab 

CountOfVIs := -1 
WinGet, id, list,ahk_class LVDChild,, Program Manager 
Loop, %id% 
{ 
CountOfVIs := CountOfVIs +1 
} 

msgbox, # of VIs open: %CountOfVIs% ;when I remove this it doesn't work - must be an AHK thing 

Send {Alt down} 
Loop,%CountOfVIs% 
{ 
Send {tab} 
Sleep,50 ;if this is too low it doesn't work 
} 
Send {Alt up} 
+0

好开始!尽管如此,它并不能算数。我有一个vi文件打开(这是2个窗口:FP和BD) - 它说我有三个。 –

+0

应该很容易追踪 - 只需运行一个WinGet,看看有什么。我通过在WIndow标题中查找vi来算数,但如果您还有其他内容显示,可以修改代码。 https://www.autohotkey.com/docs/commands/WinGet.htm – Charlie

+0

在我的实验中,ahk_class LVDChild被证明是足够可靠的 –

0

我最近发现了有关这一问题的article,但不幸的是俄语。

它使用python脚本(+ autohotkey映射)引用以下blog,该脚本似乎解决了没有“屏幕闪烁”的问题。