【问题标题】:Adding function to AHK script向 AHK 脚本添加功能
【发布时间】:2019-09-06 21:28:58
【问题描述】:

我想添加到这个脚本,以便在禁用期间,如果您按住 alt shift 或 cntrl,您仍然可以使用键 4

我的代码在按下 4 键后的一段时间内完全禁用它。

  4WasPressedAt:=A_TickCount-5200       
  ~*4::4WasPressedAt:=A_TickCount       
  #if A_TickCount-4WasPressedAt<5200    
  *4::return

如果在此期间按住另一个键,我希望它能够正常工作,然后对于延迟 4.8 秒的 3 键也是如此。

【问题讨论】:

    标签: autohotkey


    【解决方案1】:

    这可以通过向您的#If 添加更多条件来完成。请在下面查看我的解决方案。请注意,可能的缺点是 alt+4shift+4 的组合ctrl+4 只会产生4。也就是说,键入这些组合(例如 shift+4 以获得$ 的可能预期效果只会产生4

    4WasPressedAt := A_TickCount - 5200
    
    $*4::
    4WasPressedAt := A_TickCount
    Send , {4}
    Return
    
    #If (( A_TickCount - 4WasPressedAt ) < 5200 && !( GetKeyState( "Alt" ) || GetKeyState( "Shift" ) || GetKeyState( "Ctrl" )))
    *4::Return
    #If
    

    【讨论】:

      猜你喜欢
      • 2010-09-05
      • 2017-03-25
      • 1970-01-01
      • 1970-01-01
      • 2021-05-24
      • 2020-04-27
      • 2022-12-05
      • 1970-01-01
      相关资源
      最近更新 更多