Autohotkey:使用同一键的功能之间的冲突 [英] Autohotkey: Conflict between functions using the same key

查看:480
本文介绍了Autohotkey:使用同一键的功能之间的冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近使用了很多"$",并且在我的(西班牙语)键盘中,每次都必须按Shift + 4,因此我决定使用AutoHotkey来使其更快. 这个主意通过使用ç"键来加快速度,因为我不经常使用它.

I using a lot the "$" lately, and in my (Spanish) keyboard I must press Shift+4 every time, so I decided to use AutoHotkey to make it faster. The idea make it faster by using the "ç" key as I don't use it very often.

ç::
  Send $; new use of the key
Return

这很好用,但是有时候我确实需要写ç"和Ç",所以我尝试添加它.

This works well but sometimes I do need to write "ç" and "Ç", so I tried to add this

!ç::
   Send ç  ; to get the "ç" back in game
Return

+ç::
   Send Ç ;original use of the "ç" key
Return

但是它不起作用(继续发送$,因为ç"现在是"$"). 我觉得这应该很明显,但是仍然找不到解决方案.谢谢您的时间

But it's not working (keep sending $, as "ç" is now "$"). I feel like this should be pretty obvious, but still can't find a solution. Thanks for your time

推荐答案

首选直观的方式:使用ç::$代替命令块.

这将重新映射键,而不是为其分配宏.这种方法在AHK脚本中很直观,因为主要和次要语法与主要和次要意图很好地对应,即:

Preferred intuitive way: Use ç::$ instead of command block.

This will re-map the key instead of assigning it a macro. This way is intuitive in AHK scripting because primary and secondary syntax nicely corresponds with primary and secondary intent, i.e.:

  1. (主要)完全重新映射密钥(在AHK中,此操作无需宏)
  2. (第二)添加一些执行非标准功能的宏

•使用#InputLevel优先级排序

更改后的完整代码:

!ç::
   Send ç  ; to get the "ç" back in game
Return

+ç::
   Send Ç ;original use of the "ç" key
Return

; new use of the key
; ### this code has to be b̲e̲l̲o̲w̲ the macros
ç::$

经过测试,它可以按预期工作.(在1.1.25.01版,2017-03-05中)

Tested, it works as expected. (In version 1.1.25.01, 2017-03-05)

这篇关于Autohotkey:使用同一键的功能之间的冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆