【问题标题】:AutoHotkey Script to send pound (£) on double press of Shift+3双击 Shift+3 发送英镑 (£) 的 AutoHotkey 脚本
【发布时间】:2011-12-02 05:54:33
【问题描述】:

我正在尝试制作一个脚本,当您按住 Shift 并快速按两次 4 时发送英镑而不是美元。

有没有人见过做这种事情的任何代码?

编辑: 好的,我已经看过一些文档并设法让它检测到这样的双 shift+3 按下:

Shift & 4::
if (A_PriorHotkey <> "Shift & 4" or A_TimeSincePriorHotkey > 400)
{
    KeyWait, 4
    return
}
Send, £
return

但由于某种原因无法让它发送 $。有什么想法吗?

【问题讨论】:

    标签: autohotkey


    【解决方案1】:

    我最终得到了预期的功能:

    Shift & 4::
    if (A_PriorHotkey <> "Shift & 4" or A_TimeSincePriorHotkey > 800)
    {
        Send, {$}
        return
    }
    Send, {BS}
    Send, £
    return
    

    基本上,当您按下 Shift+4 时,就会打印美元。如果您仍然按住 shift 并再次按 4,则按退格键并打印 £。

    【讨论】:

      【解决方案2】:

      http://www.autohotkey.com/docs/KeyList.htm#SpecialKeys一样,你应该把键名放在“”中。

       KeyWait, "3"
      

      【讨论】:

        【解决方案3】:

        这行得通吗?

        Shift & 4::
        KeyWait, 4  ; waits for '4' to be released
        KeyWait, 4, D T.4   ; waits 400ms for 4 to be pressed again
        Send %  ErrorLevel ? "{$}" : "{BS}{£}"
            ; if ErrorLevel=1 (4 not pressed) will send $ else will send {BS}£
        return
        

        【讨论】:

          【解决方案4】:

          我以前也以复杂的方式这样做,直到我意识到解决方案非常简单:

          :*:$$::£

          只需按 $ 符号两次即可获得 £(或 €)

          顺便说一句。我对“做了同样的事情,只需按两次'即可获得”

          :?*:''::"{空格}

          {space} 对我来说是必需的,因为 " 仅在我按空格后打印。(荷兰语设置)。

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2017-09-27
            • 1970-01-01
            • 1970-01-01
            • 2018-05-07
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多