yqrashawn / GokuRakuJoudo

config karabiner with ease
GNU General Public License v3.0
1.14k stars 121 forks source link

Application Condition in Double Press #154

Open lukakemperle opened 2 years ago

lukakemperle commented 2 years ago

I'm struggling with the double press implementation and application condition: I would like to restrict this double press in space-mode to only Adobe XD.

:layers {
    :space-mode {:key :spacebar}
}
...
:applications {
    :xd ["^com\\.adobe\\.xd"]
}

The double press works as expected, anyway, not with the :xd condition.

{:des "Spacebar Mode"
        :rules [:space-mode

[:1 [:!Q0 ["doublepress-mode" 0]] ["doublepress-mode" 1]]                ; double click        

[:1 ["doublepress-mode" 1]   nil {                                       ; single clicke
        :delayed {:invoked [["doublepress-mode" 0] :!Q3]}
        :params {:delay 300}
        }]
]

Thank you for your suggestions!

yqrashawn commented 2 years ago
{:des "Spacebar Mode"
        :rules [:space-mode

[:1 [:!Q0 ["doublepress-mode" 0]] [:xd ["doublepress-mode" 1]]]                ; double click        

[:1 ["doublepress-mode" 1] :xd {                                       ; single clicke
        :delayed {:invoked [["doublepress-mode" 0] :!Q3]}
        :params {:delay 300}
        }]
]

above config (just put :xd as condition in both press) should work, if you've tried it and it won't work. try put the :xd condition into :layers defination

:layers {
    :xd-space-mode {:key :spacebar :condi :xd}
}