【问题标题】:AutoHotKey: How to disable a Skype hotkey and make your keyboard behave normallyAutoHotKey:如何禁用 Skype 热键并使您的键盘正常运行
【发布时间】:2015-07-24 23:08:24
【问题描述】:

Skype 热键真的很烦人,因为它们无法从 Skype 本身禁用。最烦人的是 Ctrl+R,如果选择了任何联系人,它就会开始与您的任何联系人进行 Skype 通话。这已被 Ctrl+Alt+R 取代。

http://community.skype.com/t5/Windows-desktop-client/Disable-CTRL-R-on-windows/td-p/2877763

不幸的是,我得到 AltGr+R 作为“è”字符的映射键(使用微软键盘创建器)。所以在我所有的应用程序中,我可以用美式键盘愉快地用法语书写,一直使用 AltGr+r 作为我的“è”字符。现在除了 Skype。

阅读上面的链接,我创建了一个 AutoKey 脚本,以禁用 Skype 的热键:

#IfWinActive, ahk_exe Skype.exe ; utilizes this script for Skype only
!^r:: ; replace [ctrl][alt][r] with nothing
#If     ; closes IfWinActive condition, needed if more code comes after this

但是,虽然这会禁用 Skype 热键,但它会阻止在 Skype 讨论中正常输入我的“è”字符。太好了,但不是最好的,因为我的打字现在在 Skype 中被破坏了。

我尝试了其他选项,但无济于事:

#IfWinActive, ahk_exe Skype.exe ; utilizes this script for Skype only
!^r:: 
Send è  
return
#If     ; closes IfWinActive condition, needed if more code comes after this

#IfWinActive, ahk_exe Skype.exe ; utilizes this script for Skype only
!^r:: 
SendInput {Raw}è  
return
#If     ; closes IfWinActive condition, needed if more code comes after this

但只要 !^r 没有被严格禁用,它就会发起 Skype 通话。

任何对 AutoHotKey 和/或 Skype 有更多经验的人来帮助我?

谢谢。

【问题讨论】:

    标签: autohotkey skype


    【解决方案1】:

    如果您将“不幸的”热键组合分配给其他东西,您可以避免整个问题。 我做了什么:

    • 转到工具->选项->高级->热键
    • 打开“启用键盘快捷键
    • ctrl + alt + r 分配给“在视频通话期间拍摄快照

    这让我发疯了,我在 Skype 论坛上找到了综合答案。

    【讨论】:

      【解决方案2】:

      请注意这一点

      #IfWinActive, ...
      !^r::
      #If
      

      热键无效:附加return关键字,所以它是!^r::return。否则,在按下 alt ctrl r 后,下面的任何代码也将被执行。

      此外,如果您只想重新映射 AltGr 热键,则应使用<^>!r:: 作为触发器,如documentation 中所建议的那样。这样,自然的alt+ctrl+r 行为将被保留,在这种情况下进行调用。


      我无法完全重现您的问题。

      #IfWinActive, ahk_exe Skype.exe
      <^>!r::
      send a
      return 
      #ifWinActive
      

      对我来说非常好用,并且不会在 Skype 中呼叫我的活跃联系人。 AltGr 被正确覆盖。 但是如果我将send a 更改为send è,脚本就会开始表现得很奇怪。它只适用于第一次:之后,我必须手动按一次 Alt 才能再次发送è。这对我来说似乎是一个错误。

      一种解决方法可能是

      #IfWinActive, ahk_exe Skype.exe
      <^>!r::
      send è
      keywait, alt
      send {alt}
      return 
      #ifWinActive
      

      #IfWinActive, ahk_exe Skype.exe
      <^>!r::
      keywait, alt
      send è
      return 
      #ifWinActive
      

      。但这仍然无法在按住altGr 的同时发送多个è。您必须在每个è 之后释放AltGr

      编辑 - 我找到了一个 100% 可行的解决方案:

      #IfWinActive, ahk_exe Skype.exe
      <^>!r::
      SendUnicodeChar(0x00E8)
      return 
      #ifWinActive
      
      ; SOURCE for the following: http://www.autohotkey.com/board/topic/16404-inserting-unicode-special-characters/
      SendUnicodeChar(charCode)
      {
          VarSetCapacity(ki, 28 * 2, 0)
          EncodeInteger(&ki + 0, 1)
          EncodeInteger(&ki + 6, charCode)
          EncodeInteger(&ki + 8, 4)
          EncodeInteger(&ki +28, 1)
          EncodeInteger(&ki +34, charCode)
          EncodeInteger(&ki +36, 4|2)
      
          DllCall("SendInput", "UInt", 2, "UInt", &ki, "Int", 28)
      }
      
      EncodeInteger(ref, val)
      {
          DllCall("ntdll\RtlFillMemoryUlong", "Uint", ref, "Uint", 4, "Uint", val)
      }
      

      这和上面一样,但是不是使用send èsend {ASC 0232},而是使用unicode格式。

      【讨论】:

      • 谢谢布劳希姆。我尝试了你的两个脚本,但在这两种情况下,Skype 都会尝试拨打电话。 :'-( 我用你的建议改变了我原来的那个(添加返回)。我在 Skype 7.4.0.102、Win 7 64、AutHotKey 1.1.22.00 上给你完整的上下文,
      • 啊,另一方面:#IfWinActive, ahk_exe Skype.exe &lt;^&gt;!r:: send e return #ifWinActive 工作得非常好。是的,è 有一些奇怪的地方,“e”总比没有好。 :)
      • 有趣的是,我试过了:#IfWinActive, ahk_exe Skype.exe &lt;^&gt;!r:: send {ASC 0232} return #ifWinActive#If 现在我重现了你的行为:它工作一次,然后键冻结,你需要按 Alt 重新启用它。
      • #IfWinActive, ahk_exe Skype.exe &lt;^&gt;!r:: keywait, alt send {ASC 0232} return #ifWinActive 是赢家:是的,我需要释放 AltGr 才能写另一个 è,但法语中没有带 double-è 的词,所以我可以接受。非常感谢您的帮助!
      • 太棒了! {ASC 0232} 解决方案的原因可能是我们的键盘布局不同.. 例如,我的是德语
      猜你喜欢
      • 1970-01-01
      • 2013-02-21
      • 1970-01-01
      • 2019-01-20
      • 1970-01-01
      • 2018-05-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多