Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有无可能加入一个双击快捷键 运行/打开 权重最高/排在首位的项目? #54

Open
jonozw opened this issue Apr 28, 2022 · 3 comments
Labels
enhancement New feature or request
Projects

Comments

@jonozw
Copy link

jonozw commented Apr 28, 2022

分类: 需求
版本: N/A

IbEverythingExt当前打开某个搜索后的结果项目的做法是, 搜索完毕后, 通过 ctrl+alt+[0-9] 运行某个编号的项目.
但是毕竟ctrl+alt+[0-9]按起来很麻烦.

能否让用户自行选择一个键, 比方说 TAB/CapsLock或者 ` , 双击这个指定的键, 直接运行 权重最高/排在首位 的项目?
这样很容易形成肌肉记忆, 会很便捷.

谢谢

@jonozw
Copy link
Author

jonozw commented Apr 28, 2022

AutoHotKey不熟悉

能否求一段代码, 实现
只在Everything窗口内监控 TAB按键. 其他程序正常响应TAB.

在Everything内部, 快速连击(300ms内)TAB -> ctrl+alt+1
非快速连击, 依然是正常的TAB?

谢谢

@Chaoses-Ib Chaoses-Ib added the enhancement New feature or request label Apr 28, 2022
@Chaoses-Ib
Copy link
Owner

临时解决方案:使用 AutoHotkey 映射:
dbpress.zip

#UseHook
SendMode "Input"

#HotIf ActiveWindowIsEverything()

Tab::
KeyTab(ThisHotkey)  ; This is a named function hotkey.
{
    static presses := 0
    if presses > 0 ; SetTimer already started, so we log the keypress instead.
    {
        presses += 1
        return
    }
    ; Otherwise, this is the first press of a new series. Set count to 1 and start
    ; the timer:
    presses := 1
    SetTimer After, -300 ; Wait for more presses within a millisecond window.

    After()  ; This is a nested function.
    {
        if presses = 1 ; The key was pressed once.
        {
            Send "{Tab}"
        }
        else if presses = 2 ; The key was pressed twice.
        {
            Send "^!1"
        }
        ; Regardless of which action above was triggered, reset the count to
        ; prepare for the next series of presses:
        presses := 0
    }
}

#HotIf

ActiveWindowIsEverything() {
    window_class := ""
    try window_class := WinGetClass("A")
    return (window_class ~= "^EVERYTHING") != 0
}

@jonozw
Copy link
Author

jonozw commented Apr 29, 2022

多谢弟兄[抱拳]

@Chaoses-Ib Chaoses-Ib added this to To do in v1.0 Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
v1.0
To do
Development

No branches or pull requests

2 participants