如何在AutoHotKey中将Tab重新映射为Win键,这样它有两个函数Tab和Win修饰符?


0

我想以这样一种方式重新映射Tab键:

  1. 在Tab键上按下BEHAVES AS WINDOWS(SUPER)KEY等待额外的键,如ex:m或t,并执行一些动作,如maxize window(例如:WIN + m,WIN + t)。它等待,Tab重复被阻止。
  2. 在Tab键上(单独)没有额外的键,Tab键的行为类似于普通Tab键(一个Tab字符)

如何编写这样的AutoHotKey脚本?

$Tab:: 
Send, {LWinDown}
KeyWait, Tab
if ( A_PriorKey = "LWinUp")
    Send, {LWinUp}          
else
    Send, {Tab}         
return

目前我有这样一个普遍的解决方案,但它仍然重复Tab。

Answers:


0

由于 Alt Tab的类似问题 在Autohotkey文档中描述。我决定使用SharpKeys软件(Windows注册表修改)将Win键重新映射到Tab键,然后应用ahk脚本

$LWin::
    KeyWait LWin, T0.15
    If !ErrorLevel ; if you hold the LWin key for less than 200 miliseconds...
        Send {Tab}
    Else ; but if it is held for more than that...
        Send {LWin Down} ; ...hold LWin down
    KeyWait LWin ; and, in both cases, wait for it to be released
    Send, {LWin Up}
Return

它比直接用ahk编写Tab键更稳定,更通用的解决方案: 答案涉及到: Win Up键作为Tab键而不是Windows菜单 1

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.