加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

AutoHotKey:如何禁用Skype热键并使键盘正常运行

发布时间:2020-12-14 05:45:42 所属栏目:Windows 来源:网络整理
导读:Skype HotKeys真的很烦人,因为它们无法从Skype本身禁用.最令人讨厌的是Ctrl R,如果它被选中,它会与您的任何联系人开始Skype通话.这最近被Ctrl Alt R取代了. 见http://community.skype.com/t5/Windows-desktop-client/Disable-CTRL-R-on-windows/td-p/2877763
Skype HotKeys真的很烦人,因为它们无法从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作为“è”字符的映射键(使用microsoft keybord creator).因此,在我的所有应用程序中,我可以用美式键盘用法语愉快地写作,使用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,一旦!^ r没有严格禁用,那么它就会启动Skype通话.

有更多使用AutoHotKey和/或Skype经验的人来帮助我吗?

谢谢.

解决方法

请注意这一点

#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正在被正确覆盖.但如果我改变发送一个发送è,脚本开始奇怪地行动.它只适用于第一次:之后,我必须手动按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,&ki,"Int",28)
}

EncodeInteger(ref,val)
{
    DllCall("ntdllRtlFillMemoryUlong","Uint",ref,4,val)
}

这与上面相同,但它不使用sendè或发送{ASC 0232},而是使用unicode格式.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读